IE不支持height:0?那只是IE对空标签默认插入空格的bug而已,overflow:hidden就可以了,这么麻烦干什么.
下面这种方法也不错:
.clear {
clear: both;
font-size: 0;
line-height: 0;
overflow: hidden;
height: 0;
visibility:hidden;
}
/* new clearfix */
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html .clearfix { zoom: 1; } /* IE6 */
*:first-child+html .clearfix { zoom: 1; } /* IE7 */