清除浮动

2018-11-24  本文已影响0人  姓高名旭升

clear

.box{
    width:100px;
    height:100px;
    background-color:red;
    clear:left;
}
清除左浮动


.box{
    width:100px;
    height:100px;
    background-color:red;
    clear:right;
}
清除右浮动


.clearfix:after

.clearfix:after{
    content:' ';
    display:hidden;
    clear:both;
}
谁塌陷就加上clearfix
上一篇下一篇

猜你喜欢

热点阅读