(1)额外标签法:在父元素内容最后面加一个块级元素设置css属性为clear:both
(2)单位元素法:给父盒子设置css属性为.box::after{
content:""
display:block;
clear:both;
}
(3)双为元素法:.box::after , .box::before{
content:""
display:table;
}
.box::after{
clear:both
}
(4)给父级添加overflow 溢出隐藏
overflow:hidden