元素内部清除浮动(兼容IE6)
1 overflow:hidden; 2 zoom:1;
伪元素清除浮动
1 .clearfix:after { 2 content: " "; 3 display: block; 4 height: 0; 5 visibility: hidden; 6 clear: both; 7 } 8 9 .clearfix { 10 *zoom: 1; 11 }
元素内部清除浮动(兼容IE6)
1 overflow:hidden; 2 zoom:1;
伪元素清除浮动
1 .clearfix:after { 2 content: " "; 3 display: block; 4 height: 0; 5 visibility: hidden; 6 clear: both; 7 } 8 9 .clearfix { 10 *zoom: 1; 11 }
转载于:https://www.cnblogs.com/Millet-23/p/9304929.html