clear
.box{
width:100px;
height:100px;
background-color1:yellow;
clear:left;
}
清除左浮动
.box{
width:100px;
height:100px;
background-clor:yellow;
clear:right;
}
清除右浮动
1.both可以清除对它影响最大的浮动
2.可以解决高度塌陷
.clearfix:after
.clearfix:after{
content:" ";
display:hidden;
clear:both;
}
谁塌陷就加上clearfix
网友评论