我的布局基本上是这样的:
<body>
<div style="height: 150px; width: 200px; background: green">
<div style="overflow: auto; max-height: 100px; background: blue">
some content <br/>
some content<br/>
some content<br/>
some content<br/>
some content<br/>
some content<br/>
some content
</div>
<div style="overflow: auto; background: red">
some more content<br/>
some content<br/>
some content<br/>
some content<br/>
some content
</div>
</div>
</body>
现在,我希望第二个div填满父div的所有剩余高度,并在需要更多空间时显示滚动条。我该怎么做呢? 目前,第二个div从不显示滚动条,只是使用它所需的空间,即使这会超出父容器的总高度... 更新: 请测试您提供的解决方案 :-)