DIV 浮動存不占空間
比如
<div style="width:80px; border:1px solid #333">
<div style="float:left; height:50px; width:20px; background:#CCC"></div>
<div style="float:left; height:70px; width:50px; background:#000"></div>
</div>
你會發現因為里面的2個元素浮動,所以外面的DIV高度還是2px 2px是邊框的。
浮動元素不占空間,
所以一般在下面加一個清除浮動就可以解決這個BUG
<div style="width:80px; border:1px solid #333">
<div style="float:left; height:50px; width:20px; background:#CCC"></div>
<div style="float:left; height:70px; width:50px; background:#000"></div>
<div style=" clear:both"></div>
</div>
