清除浮动:
1.选择器{clear:属性值(left/right/both)}
2.给父级添加overflow:hidded(auto/scroll)
3.使用after清除浮动:
类名器:after{content:"." ; display:block ; height:0 ; clear:both ; visitility:hidden;}
类名器:{*zoom:1;}
4.使用before和after清除浮动:
类名器:before,
类名器:after{content:"." ; display:table ; }
类名器:before{clear:both;}
类名器:{*zoom:1;}
清楚浮动的4种方法
最新推荐文章于 2024-08-14 09:51:23 发布