码迷,mamicode.com
首页 > 其他好文 > 详细

【转载】那些年我们一起清除过的浮动demo

时间:2014-08-07 00:26:47      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   os   io   strong   

 

返回文章:那些年我们一起清除过的浮动

闭合浮动 与 清除浮动 的区别

.main:很抱歉,现代浏览器中我没能把warp撑高(float:left)
.side:我也浮动了(float:left)
.main:warp自己闭合浮动了,所以footer不用再清除浮动了(float:left)
.side:我也浮动了(float:left)

闭合浮动的几种方法

1)添加额外标签

.main{float:left;}
.side{float:right;}
 

2)使用 br标签和其自身的 html属性

.main{float:left;}
.side{float:right;}

3)父元素设置 overflow:hidden

.main{float:left;}
.side{float:right;}

6)父元素设置display:table

.main{float:left;}
.side{float:right;}

 转自:http://www.iyunlu.com/demo/enclosing-float-and-clearing-float/index.html

【转载】那些年我们一起清除过的浮动demo,布布扣,bubuko.com

【转载】那些年我们一起清除过的浮动demo

标签:style   blog   http   color   使用   os   io   strong   

原文地址:http://www.cnblogs.com/crazybottle/p/3895913.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!