1
我已經浮動的div,後面跟着一個非浮動div。下面的div忽略浮動div的高度。什麼CSS命令失蹤,以防止這種情況?前面的div浮動和摺疊
HTML
<div class="wrap">
<div class="left">left</div>
<div class="right">right</div>
<div class="bottom">bottom</div>
CSS
.wrap{
width: 400px;
height: 350px;
background-color: grey;
}
.left{
width: 150px;
height: 150px;
background-color: blue;
position : relative;
float: left;
}
.right{
width: 150px;
height: 150px;
background-color: red;
position : relative;
float: right;
}
.bottom{
width: 200px;
height: 100px;
background-color: green;
position : relative;
}
的[浮點創建重疊的div](可能重複http://stackoverflow.com/questions/1023159/float-創建重疊-的div) –