浮动

参考

如何处理浮动

给父元素增加一个伪类after

.outer {zoom:1;}    /*==for IE6/7 Maxthon2==*/
.outer :after {clear:both;content:'.';display:block;width: 0;height: 0;visibility:hidden;}   /*==for FF/chrome/opera/IE8==*/

参考

.clear-fix { *overflow: hidden; *zoom: 1; }  
.clear-fix:after { display: table; content: ""; width: 0; clear: both; }  

你可能感兴趣的:(浮动)