第三天,谈谈【清除浮动】

step 1,提出问题

HTML

<div class="container box">
    <div class="left">左浮动</div>
    <div class="right">右浮动</div>
</div>
<div class="btm"></div>

CSS

.container{
    border:1px solid blue;
    /*我就可以清除浮动*/
}
.left{
    float:left;
    width: 50px;
    height: 50px;
    background-color:yellow;
}
.right{
    float:right;
    width: 100px;
    height: 100px;
    background-color:red;
}
.btm{
  clear:both;
  height:50px;
  background-color: green;
  margin-top:50px;
}