方法1:
构建BFC/haslayout
但是这种方法时块内与外部隔绝了
方法2:
比较兼容的方法:
用在包含浮动子元素的父元素上
.clearfix:after{ content:";display;block;height:0;overflow:hidden;clear:both }
.clearfix{*zoom:1}IE6/IE7
方法3:更简短
.clearfix:after{content:";display:table;clear:both}
.clearfix{*zoom:1} IE6/IE7