我对这些代码片段有一些问题:
CSS:
#wrapper{
width: 600px;
background: gray;
}
#left{
float: left;
width: 150px;
height: 80px;
background: red;
}
#right{
float: left;
width: 450px;
height: 150px;
background: yellow;
}
HTML:
<div id="wrapper">
<div id="left"></div>
<div id="right"></div>
</div>
左边的高度是 80px,右边的高度是 150px。我希望这件事看起来像这样:http: //img408.imageshack.us/img408/9978/dream.th.jpg 以上来自 IE 的屏幕截图,当我使用 IE 时,这些片段完美运行。但是当我使用其他浏览器(opera、FF、Safari、Chrome)时,我得到了这个:http: //img408.imageshack.us/img408/869/fact.th.jpg
这并不酷......我希望父(#wrapper)元素的高度获得两个孩子的更大高度。