【问题标题】:IE8 Sticky Footer ProblemsIE8 粘滞页脚问题
【发布时间】:2012-02-05 13:32:48
【问题描述】:

如果您在 Firefox 中查看 this,您会看到底部页脚在您调整大小、移动等时与窗口保持一致。它也从底部开始,没有滚动条。但是,在 IE8 中,我不能让它在开始时坐在底部或随窗口移动,可能还有其他一些问题。我从this site 得到代码,它说它与 IE 兼容,所以我一定是做错了什么。我不得不稍微修改一下代码以适应我的情况,但这里是 IE 特定的 css:

* {
margin: 0;
}

#container{
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -30px;
}

#footer, .push{
height: 30px;
width: 100%;
background: -moz-linear-gradient(top, #565656, #303030);
background: -webkit-gradient(linear, left top, left bottom, from(#565656), to(#303030));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#565656', endColorstr='#303030');
text-align:center;
font-family: loginfont;
font-size:13px;
color: #fff;
padding-top:5px;
clear: both;
}

谁能告诉我出了什么问题?在这一点上我完全无能为力。我讨厌 IE...

【问题讨论】:

    标签: css internet-explorer internet-explorer-8 footer sticky-footer


    【解决方案1】:

    我不确定,但它可能是导致问题的padding-top:5px;。尝试将 margin: 0 auto -30px; 更改为 margin: 0 auto -35px; 看看是否有帮助。

    【讨论】:

      【解决方案2】:

      在您的#container 中添加<div class="push"></div> 并将position:relative; 添加到#container,因为负边距不适用于静态定位的元素。

      【讨论】:

        猜你喜欢
        • 2014-05-26
        • 1970-01-01
        • 1970-01-01
        • 2013-02-20
        • 2015-01-02
        • 1970-01-01
        • 2012-09-21
        • 2016-07-08
        • 1970-01-01
        相关资源
        最近更新 更多