是每个设计师追求的目标,按一般的做法,大多采用背景图填充、加JS脚本的方法使列的高度相同,
本文要介绍的是采用容器溢出部分隐藏和列的负底边界和正的内补丁相结合的方法来
解决列高度相同的问题。
得到高度正确,所以要过滤掉上面的代码。
/*\*/#sideleft, #sideright{ padding-bottom: 32767px; margin-bottom: -32767px; }/**/
Opera
1. Opera7.0-7.2不能正确清除溢出部分,所以要加:
/* easy clearing */#wrap:after { content: '[DO NOT LEAVE IT IS NOT REAL]'; display: block; height: 0; clear: both; visibility: hidden; }#wrap { display: inline-block; }/*\*/#wrap { display: block; }/* end easy clearing *//*\*/
2. Opera8处理overflow: hidden有个BUG,还得加上以下代码:
/*\*/#sideleft, #sideright { padding-bottom: 32767px !important; margin-bottom: -32767px !important; }@media all and (min-width: 0px) {#sideleft, #sideright { padding-bottom: 0 !important; margin-bottom: 0 !important; }#sideleft:before, #sideright:before { content: '[DO NOT LEAVE IT IS NOT REAL]'; display: block; background: inherit; padding-top: 32767px !important; margin-bottom: -32767px !important; height: 0; }}/**/
Opera9的B2在修正8的bug.
测试环境:IE5.01、IE5.5、IE6.0、Firefox1.5、Opera8.5、Netscape 7.2通过。
最终效果
原文:http://HdhCmsTestpositioniseverything.net/articles/onetruelayout/equalheight
请注意:网友momomolo测试时发现,当页面长度到2000px,opera中就出问题了,现在还没有解决的办法.
查看更多关于EqualHeightColumns--DIV+CSS布局中自适应高度的解决方法_html/css_的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did102740