隻有浮動層子元素情況下,為了撐開父元素的框可以使用添加clear:both層的技巧(或者類似技巧如:after僞元素),或者設定overflow:hidden的方法。但是在IE6下還是可能無法顯示。
<div style="background-color:red;border:solid;height:1%">
<div style="width:300px; height:100px; float:left;">
左側
</div>
<div style="width:300px; height:100px; float:left">
中部
<div style="width:360px; height:100px; float:left">
右側
<div style="clear:both">
</div>