首页 > 代码库 > 闭合浮动

闭合浮动

方法一:

.clearfix:after {content:"."; display:block; height:0; clear:both; } 
.clearfix { *zoom:1; }

方法二:

.clearfix:before,.clearfix:after { 
    content:""; 
    display:table; 

.clearfix:after { clear:both; }/* For IE 6/7 (trigger hasLayout) */ 
.clearfix { zoom:1; } 

闭合浮动