【发布时间】:2016-03-17 06:18:16
【问题描述】:
我已经尝试了很多方法来使用 css calc 和表格布局来获得滚动条。下面是我的小提琴。非常感谢任何帮助。
JSFIDDLE:http://jsfiddle.net/y3U8F/124/
这里,我想要#content的滚动条
HTML:
<div class="displayTable">
<div class="displayTableCell">
<div id="content">
body content<br>body content<br> ...
</div>
<footer>copyright etc</footer>
</div>
</div>
CSS:
html, body {
height: 100%;
}
#content {
height: -webkit-calc(100% - 50px);
background-color: yellow;
overflow:auto
}
footer {
height: 50px;
background-color: grey;
}
.displayTable{display:table;table-layout:fixed;width:100%}
.displayTableCell{display:table-cell}
【问题讨论】:
-
好的。我已经添加了它。对不起,我赶时间。