高度自适应
| 以下是引用片段: #container { overflow: hidden; } #container .column { padding-bottom: 20010px; /* X + padding-bottom */ margin-bottom: -20000px; /* X */ } #footer { position: relative; } |
这个代码起源于adapted wholesale。
遗憾的是现在Opera还不支持#container的overflow,期待版本9。
现在IE还不能真正的自适应高度,还要加下面的代码,如果你需要#footer,可再加个DIV(#footer外面)。
以下是引用片段:
<div id="footer-wrapper">
<div id="footer"></div>
</div>
| 以下是引用片段: * html body { overflow: hidden; } * html #footer-wrapper { float: left; position: relative; width: 100%; padding-bottom: 10010px; margin-bottom: -10000px; background: #fff; /* Same as body background */ } |
原文标题:In Search of the Holy Grail如果需要有更详尽的了解,请看原文:http://www.alistapart.com/articles/holygrail
阅读关于 网页 三列 自适应高度 布局 网页陶吧 龙犊 的全部文章
热卖推荐: 手机 诺基亚 MP5 电脑包 双卡双待 手机链 U盘 笔记本电脑关注此文的读者还看过: