Internet explorer 8 IE8怪癖模式下相邻div之间的奇怪间隙

Internet explorer 8 IE8怪癖模式下相邻div之间的奇怪间隙,internet-explorer-8,quirks-mode,html,gaps-in-visuals,Internet Explorer 8,Quirks Mode,Html,Gaps In Visuals,我在怪癖模式下遇到IE8问题。我有一个外部div元素,它包含两个内部div <div style="margin-left:160px; margin-top:10px; margin-right:0px; height:10px; background:blue;"> <div style="position:relative; float:left; width:10px; height:10px; background:orange;"></div&g

我在怪癖模式下遇到IE8问题。我有一个外部div元素,它包含两个内部div

<div style="margin-left:160px; margin-top:10px; margin-right:0px; height:10px; background:blue;">
    <div style="position:relative; float:left; width:10px; height:10px; background:orange;"></div>
    <div style="position:relative; margin-left:10px; margin-right:0px;height:10px; background:green;"></div>
</div>

内部div应该覆盖整个包装器div,并且在firefox和chrome中工作良好。但当我在IE8中看到这一点时,橙色div和绿色div之间有一个奇怪的差距。有人知道如何解决这个问题吗?此外,我不能将doctype声明放在文档中的任何位置。

对于怪癖模式,在内容上使用绝对定位,在容器上使用相对定位:

怪癖模式测试