IE中某些分辨率的填充问题

时间:2012-09-19 21:53:37

标签: css

我的页脚在IE中以某些分辨率溢出到新行。我认为这是一个填充问题,只是推送内容比容器更宽。它似乎只是在某些分辨率上包裹,这对我来说没有意义,因为容器的宽度远小于屏幕的分辨率。似乎无法找到解决方案。

CSS:

#footer
{
    width: 100%;
    background-color: #4e4e4e;
    padding: 0 0 0;
    margin: 0;
    clear: both;
}
#sitemap
{
    width: 300px;
    padding: 20px 0;
    margin: 0 auto;
    clear: both;
}

#left_map
{
    float: left;
    border-right: 1px dotted #ffffff;
}
#right_map
{
    float: right;
    padding: 30px 0;
}
#copyright
{
    font-size: 10px;
    font-family: inherit;
    color: #ffffff;
    text-align: center;
    padding: 20px 0 0;
    clear: both;
}

HTML(片段):

<div class="clear"></div>
<div id= "footer">
    <div id="sitemap">
        <div id="left_map">
            <h4>Sitemap</h4>
            <ul>
                <li><a class="selected" href="index.html">Home</a></li>
                <li><a href="about.html">About</a></li>
                <li><a href="services.html">Services</a></li>
                <li><a href="gallery.html">Gallery</a></li>
                <li><a href="contact.html">Contact</a></li>
            </ul>
        </div>
        <div id="right_map">
            <img src="images/footer_logo.png">
        </div>
    </div>
    <div id= "copyright">
        <p>Copyright © 2012 Cornerstone Masons</p>

    </div>
</div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

需要考虑的一些想法:

  • IE使用自己的盒子模型。对于在Quirks模式下添加或忽略容器宽度和边框宽度,在IE上填充的计算方式与Moz和Webkit不同,因此请确保您有一个doctype,强制IE使用符合标准的模式来避免这种打嗝。
  • 确保带有溢出的屏幕不会在浏览器级别无意中放大。在Windows上按CTRL + 0或在mac上命令+ 0设置为默认缩放。
  • 您的填充为padding: 0 0 0;,表示左边距可能会恢复为默认值。我之所以这么说是因为IE是迟钝的,我不会因为误读特定版本而将它放在过去。