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

.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

相关文章:

  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-02-27
  • 2022-01-14
猜你喜欢
  • 2022-02-22
  • 2022-01-09
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案