css 清除浮动方法
2011-11-28 11:34
651 查看
1.使用空标签清除浮动 <style type="text/css"> .clear{clear:both;font-size:0px;height:0px;line-height:0px;overflow:hidden;} </style> <div style="background:blue;"> <div style="float:left;width:400px;height:300px;background:red;">red</div> <div style="float:left;width:400px;height:300px;background:gray">ball</div> <div class="clear"></div> </div> 2.使用after伪对象清除浮动 <style type="text/css"> .ft_clear:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0;} .ft_clear {zoom:1;}/*IE6*/ </style> <div style="background:blue;" class="ft_clear"> <div style="float:left;width:400px;height:300px;background:red;">red</div> <div style="float:left;width:400px;height:300px;background:gray">ball</div> </div>
相关文章推荐
- CSS中常用的清除浮动(闭合浮动)的方法
- CSS清除浮动的几种方法
- CSS 8种清除浮动的方法
- 关于css清除浮动的方法
- css清除浮动的方法
- css清除浮动大全,共8种方法
- [css]css之浮动与清除浮动各方法原理介绍
- Html+CSS CSS(CSS3) 3种清除浮动的方法
- CSS清除浮动常用方法小结 CSS clear both {overflow:auto;zoom:1;}
- css清除浮动方法大全
- CSS常用清除浮动方法总结
- css清除浮动的几种方法以及对应规范说明
- css清除浮动float的三种方法总结,为什么清浮动?浮动会有那些影响?一起来$('.float')
- html+css----清除浮动的方法
- css清除浮动使父级元素展开的三个方法
- CSS清除浮动的简单方法
- CSS清除浮动大全共8种方法
- 8种CSS清除浮动的方法优缺点分析
- 关于css清除元素浮动的方法总结(overflow clear floatfix)
- CSS清除浮动常用的三种方法