在IE7下,大box下方似乎多了一个padding-bottom的距离,现在要求内部所有部分高度是自动的。
正常情况下:
ie7下:
不使用的方法:
1、黄色部分也浮动;//因为右侧黄色box有时内部也有复杂的内容布局,不能做到全部浮动
2、ie7hack;
3、固定高度;
那么还有高明的什么方法呢?
代码如下
*{ margin:0; padding:0;}li{ list-style:none;}.fix{zoom:1;}.fix:after{content:""; display:block; clear:both; height:0; visibility:hidden;}.box{ width:400px; margin:0 auto; border:1px solid #f69; margin-bottom:20px; margin-top:50px;}.box_left{ width:260px; float:left;}.box_right{ width:120px; float:right; background:#FFC;}.not_float{ width:100%; height:40px; margin-bottom:20px; background:#FFC;}.ready_float_left{ width:160px; float:left; background:#09f; color:#fff;}.ready_float_right{ width:80px; float:right; background:#09f; color:#fff;}.box2{ width:400px; height:100px; margin:0 auto; border:1px solid #f69;}
查看更多关于css浮动的ie7兼容问题,下边距增加_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did111357