html - ie6边距扩大20px

标签 html css internet-explorer-6

我将 div 包裹在我的 html 代码下面。

    <div id="content-row">
         <div id="left-box">
              <div id="small-box">
              </div>
              <div id="small-box">
              </div>
              <div id="small-box">
              </div>
              <div id="small-box">
              </div>
        </div>
     </div>

我的CSS是

/*content-row*/
#content-row {
    margin: 0 auto!important;
    padding-left:50px;
    width:990px;
    height:320px;
    padding-bottom:20px;    
}
#left-box {
    float:left;
    width:360px;
    height:340px;
}
#small-box {
    width:160px;
    height:150px;
    background-color:#fff;
    float:left;
    margin:0px 20px 20px 0px;
}

以上样式表专用于ie6。我的问题是左框在右侧多了 20px。当我将左框定义为 360px 时;它取为 380px;

这里是完整代码的链接。

http://jsfiddle.net/HXGsT/

代码有什么问题?

最佳答案

这是 IE6 中的已知 bg,请参阅此页面了解更多信息: http://www.positioniseverything.net/explorer/doubled-margin.html

基本上,快速修复是将 display: inline; 添加到 float 元素。

关于html - ie6边距扩大20px,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3819853/

相关文章:

html - ie6 显示透明背景的图像 (.PNG) 背景颜色

javascript - 什么是 IE6 同源策略

html - 如何让评论计数在评论气泡图像上显示为文本?

html - 在容器中的表格下方添加文本

html - 很难修复具有动态内容的 div 的高度

css - 变换原点 50% 垂直

javascript - IE6、IE7 中查询字符串过长的解决方法?

javascript - 如何在html表格中选择一行取2列相乘并在第三列显示结果

html - 浏览器如何处理格式错误的 HTML?

html - 停止文本移动html