CSS浮动
2020-12-12 22:40
标签:style blog class strong http com CSS清浮动:==>抄自梦想天空:http://www.cnblogs.com/lhb25/p/3674353.html 上代码: 因为浮动导致盒模型为闭合的闭合方法: 1:使用额外的标签 : 2:.clearfix:after { clear:both; content:"."; display:block; height:0;
visibility:hidden; }.clearfix { *zoom:1;} 3: overflow:hidden; *zoom:1; 4: 父元素设置display:table 优化后的cf:
2:
/* For modern browsers */
.cf:before,.cf:after {
content:"";
display:table;
}
.cf:after { clear:both; }/* For IE 6/7 (trigger hasLayout) */
.cf { zoom:1; }
CSS浮动,搜素材,soscw.com CSS浮动 标签:style blog class strong http com 原文地址:http://www.cnblogs.com/diligenceday/p/3706157.html所有代码访问:http://www.iyunlu.com/demo/enclosing-float-and-clearing-float/index.html
那些年我们一起清除过的浮动/h1>
闭合浮动 与 清除浮动 的区别
闭合浮动的几种方法
1)添加额外标签
2)使用 br标签和其自身的 html属性
3)父元素设置 overflow:hidden
6)父元素设置display:table
1:
.clearfix:after {content:"\200B"; display:block; height:0; clear:both; }
.clearfix { *zoom:1; }.