1.给父盒子设置高度
2.额外标签发
<div style="clear:both"
3.常用的两种方法(伪元素清楚浮动)和添加overflow方法
.clearfix::before,.clearfix::after{
content:"";
display:table;
clear:both;
}
.clearfix{
zoom:1;
}
4.在样式中加入
overflow:hidden;
1.给父盒子设置高度
2.额外标签发
<div style="clear:both"
3.常用的两种方法(伪元素清楚浮动)和添加overflow方法
.clearfix::before,.clearfix::after{
content:"";
display:table;
clear:both;
}
.clearfix{
zoom:1;
}
4.在样式中加入
overflow:hidden;