IE6中的边缘问题很奇怪

时间:2011-08-17 04:42:47

标签: html css margin internet-explorer-6

HTML:

<div id="outter">
    <div id="left">
        <div id="up">
            This is the up div
        </div>
        <div id="down">
            <h3>This is the down div</h3>
        </div>
    </div>
</div>   

CSS:

#outter{
    height: 400px;
    background: white;
    border: 1px solid #bfd2e1;
}
#left{
    float: left;
    margin-right: 0;
    padding: 0;
}
#up{
    width: 355px;
    height: 50px;
    border: 1px solid #ffe59f;
    padding: 12px;
    line-height: 16pt;
    margin: 15px 0 0 15px;
}
#down{
    float: left;
    margin: 15px 0 0 15px;
    width: 381px;
}
#down h3{
    border: 1px solid #bfd2e1;
    background-color: #edf6fe;
    padding: 10px;
}

问题是,在Chrome / Firefox中,页面如下所示:
enter image description here
但在IE6中:
enter image description here
如您所见,#down存在保证金问题 小提琴:http://jsfiddle.net/wong2/dTEcs/1/
怎么会发生这种情况?

1 个答案:

答案 0 :(得分:6)

IE6 doubles margins on floated elements

display: inline添加到您的浮动元素(#down)。