SOURCE

console 命令行工具 X clear

                    
>
console
<div class="parent clearfix">
    <div class="child1"></div>
    <div class="child2"></div>
</div>
.parent {
    width: 300px;
    background-color: pink;
    border: 1px solid pink;
}
.child1 {
    float: left;
    width: 100px;
    height: 50px;
    background-color: red;
}
.child2 {
    float: right;
    width: 100px;
    height: 50px;
    background-color: green;
}

.clearfix::after {
    content: "\20";
    height: 0;
    display: block;
    clear: both;
}

.clearfix {
    zoom: 1;
}