编辑:这只发生在IE8中,在IE7、Firefox、Opera等浏览器中运行正常。
首先,这里有一张我用Photoshop制作的图片来说明我的问题:http://richardknop.com/pict.jpg
现在你应该对我的问题有了想法。这是我正在使用的简化版标记(我省略了大部分不相关的内容):
<div class="left">
<div class="box">
// box content
</div>
<div class="box">
// box content
</div>
<div class="box">
// box content
</div>
</div>
<div class="right">
<div class="box">
// box content
</div>
<div class="box">
// box content
</div>
<div class="box">
// box content
</div>
</div>
<div class="clear"></div>
<div class="box">
//
// NOW THIS BOX HAS NO TOP MARGIN
//
</div>
<div class="box">
// box content
</div>
同时,CSS 样式的写法如下:
.clear {
clear: both;
}
.left {
float: left;
}
.right {
float: right;
}
.box {
overflow: auto;
margin-top: 10px;
}
显然,我省略了所有不相关的样式,如边框、背景颜色和图片、字体大小等。我只保留了重要的内容。
你有什么想法,问题可能出在哪里?