清除浮动方法
1.添加额外标签设置clear:both属性 <div style="clear:both"></div> 2.使用 br标签和其自身的 html属性 3.父元素设置 overflow的非 visible 值(overflow:auto/overflow:hidden) 4.父元素也设置浮动 float:left 5.父元素设置display:table display:table 6.使用:after 伪元素 .clearfix:after{ content : "." ; clear:both;overflow:hidden;display:bolck;height:0;visibility:hidden } .clearfix{*zoom:1;}/* 激活IE 6,7的haslayout*/ 7.在 IE 6/7 的标准文档模式中设置 “width/height/zoom” 等样式来自动清理浮动。 通过 为知笔记 发布 来源: https://www.cnblogs.com/zjx2011/archive/2012/09/14/2684891.html