css清除浮动
1.父级after伪元素法
<style>
.clearfix:after{
content: "";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix{ /* IE6、7专有 */
*zoom: 1;
}
</style>
2.父级双伪元素法
<style>
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
/* IE6、7专有 */
*zoom: 1;
}
</style>
3.父级添加overflow
<style>
div{
overflow: hidden;
}
</style>