- 【.clr{clear:both;}】,设置了clear属性的元素,其上边框会紧贴着浮动元素的margin-bottom边界位置渲染,忽略其margin-top设置。
- 空标签清浮动:【 】【.clr{clear:both;height:0;overflow:hidden;}】,不推荐。
- 伪类after清浮动:【.clr:after{content:"
";clear:both;display:block;height:0;visibility:hidden;line-height:0;}
.clr{zoom:1}】。
- 使用【display:table】。
- 使用overflow除visible,类似于激发haslayout。
- 使用浮动父元素清浮动。
几个css清浮动的方法【2012/07/18】,布布扣,bubuko.com
几个css清浮动的方法【2012/07/18】
原文:http://www.cnblogs.com/zhengyingyan/p/3627198.html