css经典清除浮动的方法
<div class="box clearfix">
<div class="left"></div>
<div class="right"></div>
</div>
<style>
.left {
width: 200px;
height: 200px;
background: yellow;
float: left;
}
.right {
width: 200px;
height: 200px;
background: green;
float: right;
}
.clearfix::before,
.clearfix::after{
display:table,
content:' ',
clear:both
}
</style>