1
我有一個結構類似於模態窗口,它看起來像這樣:溢出自動
.pos_container {
\t \t display:block;
\t \t vertical-align:top;
\t \t width:70%;
\t \t height:auto;
\t \t margin:auto;
\t \t -webkit-border-radius: 5px;
\t \t -moz-border-radius: 5px;
\t \t border-radius: 5px; \t
\t \t border:1px solid #ddd;
\t \t position:relative;
\t \t top:5%;
\t \t max-height:90%;
\t \t overflow:hidden;
\t }
\t .pos_header {
\t \t display:block;
\t \t vertical-align:top;
\t \t padding:15px 20px;
\t \t background:#f7f7f7;
\t \t -webkit-border-top-left-radius: 5px;
\t \t -webkit-border-top-right-radius: 5px;
\t \t -moz-border-radius-topleft: 5px;
\t \t -moz-border-radius-topright: 5px;
\t \t border-top-left-radius: 5px;
\t \t border-top-right-radius: 5px;
\t \t border-bottom:1px solid #ddd;
\t \t
\t }
\t .pos_body {
\t \t display:block;
\t \t vertical-align:top;
\t \t padding:10px 20px;
\t \t background:#fff;
\t \t overflow-y:auto;
\t \t height:100%;
\t }
\t <div class="pos_container">
\t \t <div class="pos_header">
\t \t \t // SOME CONTENT HERE, ALWAYS HAS FIXED HEIGHT
\t \t </div>
\t \t <div class="pos_body">
\t \t \t // CONTENT IN HERE CAN BE VARIOUS HEIGHT, NEED AUTO-SCROLL
\t \t </div>
\t </div>
我在網上搜索,始終有一個規則,設置.pos_body
到一定高度的高度,但我需要它適合的.pos_container
可見部分,並在.pos_body
情況下,內容重疊.pos_container
然後滾動出現
你就不能使用溢出:滾動? –
@TheInterloper在這種情況下,我有滾動條,但'.pos_body'的內容不可滾動 –