前端开发里几种清除浮动的方法
1、伪元素法:
.clear {
zoom: 1;
}
.clear :after {
clear: both;
content: '.';
display: block;
width: 0;
height: 0;
visibility: hidden;
}
2、overflow:hidden;
3、给浮动元素的祖先元素加高度;
4、clear:both;
5、隔墙法;
1、伪元素法:
.clear {
zoom: 1;
}
.clear :after {
clear: both;
content: '.';
display: block;
width: 0;
height: 0;
visibility: hidden;
}
2、overflow:hidden;
3、给浮动元素的祖先元素加高度;
4、clear:both;
5、隔墙法;