这是我的代码:
<!DOCTYPE>
<html>
<body>
<div class="main">
<div id="div1" style="float: left;height: 200px;border:1px solid red; ">1</div>
<div style="clear:both"></div>
<div id="div2" style="border:1px solid red;margin-top:20px;background-color: #FFF; ">2</div>
</div>
</body>
</html>
在Chrome margin-top
中启用,div1 和 div2 分开 20px;但在IE8中,div1 和 div2 总是保持在一起。</p>