我有这个:
<div class="one">
<h2>Title that can be quite long and I don't know it's height</h2>
<div class="two">Content that can overflow and that needs to be scrolled (but the title needs to remain up so that won't scroll</div>
</div>
这个CSS:
.one{height: 250px; width: 120px;}
.two{overflow:auto;}
但我无法得到.two来做滚动。我不知道.two或h2的高度。另外我只想.two来做滚动。
答案 0 :(得分:3)
我为你做了http://jsfiddle.net/zm8Lj/。请看一下。
答案 1 :(得分:1)
.two{overflow:auto; height:200px;}
答案 2 :(得分:1)
答案 3 :(得分:0)
如果你的标题不是从顶部移动,请用div包装并给它position: fixed; top: 0px; lwft: 0px;