问答详情
源自:2-4 浮动 float

清除浮动代码如下:


.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

提问者:missxu 2014-09-29 21:20

个回答

  • ylq
    2015-08-02 10:09:21

    与clear: both;有什么不同吗