【发布时间】:2011-03-25 14:08:45
【问题描述】:
我想知道这是否可以通过简单的 css 实现,或者我是否必须为此使用 javascript?
我的网站上有一个侧边栏。一个简单的 div#sidbar 它通常大约 1024px 高,但高度会因为它的内容而动态变化。
让我们想象一下下面的例子:
<div id="sidebar">
<div class="widget"></div> //has a height of 100px
<div class="widget"></div> //has a height of 100px
<div id="rest"></div> //this div should have the rest height till to the bottom of the sidebar
</div>
我希望 div#rest 填充侧边栏的其余部分,直到它到达 div#sidebar 的底部。
纯css可以做到吗?
【问题讨论】: