1
我嘗試創建佈局「視口」,固定高度爲頂部,固定高度爲頁腳,中間部分爲剩餘高度。我需要使用div標籤來做到這一點。這裏發生了什麼事固定高度使用div標籤的佈局視口
HTML:
<div class="table-cui-a2c">
<div class="row-cui-a2c" style="height: 50px;">
<div class="cell-cui-a2c">
</div>
</div>
<div class="row-cui-a2c" >
<div class="cell-cui-a2c" >
<div class="block" ></div>
</div>
</div>
<div class="row-cui-a2c" style="height: 50px;">
<div class="cell-cui-a2c">
</div>
</div>
CSS:
html {display:block; position:static; width:100%; height:100%; margin:0px; padding:0px; border:none; overflow:hidden;}
body {font-family:Helvetica, "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:14px; width:100%; height:100%; font-weight:300; padding:0px; margin:0px;}
html * {box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box;}
.table-cui-a2c {display:table; width:100%; height:100%;}
.row-cui-a2c {display:table-row; width:100%; height:100%;}
.cell-cui-a2c {display:table-cell; text-align:center; vertical-align:middle; border:1px dotted black; overflow:scroll;}
.block {display:block; width:100%; height:200%; background:#d0d0d0; border:1px dashed red;}
http://jsfiddle.net/roskoshinsky/htv2bq1q/
我希望這將是垂直滾動的核心部分。但是這沒有發生。而且,我在FireFox中看到了錯誤的映射。
如何解決這個問題?
這就是你想要的? https://jsfiddle.net/lmgonzalves/htv2bq1q/1/ – lmgonzalves