清除浮动代码如下:
.clearfix:after {
content: " ";
display: block;
clear: both;
height: 0;
}
.clearfix {
zoom: 1;
display: table;
}
应用:
<div class="clearfix">
<div class="floated"></div>
</div>
详见:
http://www.imooc.com/wenda/detail/11605
与clear: both;有什么不同吗