出现问题的代码:
.divcss5{
width:500px;
border:1px solid #000;
padding:10px
}
.divcss5-lf{
float:left;
width:220px;
height:100px;
background:#000
}
.divcss5-rt{
float:right; width:230px;
height:100px;
background:#06F
}
<div class="divcss5">
<div class="divcss5-lf"></div>
<div class="divcss5-rt"></div>
</div>
解决方法:
使用clear
.clear{
clear:both
}
<div class="divcss5">
<div class="divcss5-lf"></div>
<div class="divcss5-rt"></div>
<div class="clear"></div>
</div>
效果如下: