Css IE8粘性页脚问题
如果您在Firefox中查看,您将看到底部页脚在调整大小、移动等操作时与窗口保持一致。它也从底部开始,没有滚动条。然而,在IE8中,我无法让它在开始时坐在底部,或者随着窗口移动,可能还有许多其他问题。我从那里得到了代码,它说它与IE兼容,所以我一定是做错了什么。我不得不稍微修改代码以适应我的情况,但以下是IE特有的css:Css IE8粘性页脚问题,css,internet-explorer,internet-explorer-8,footer,sticky-footer,Css,Internet Explorer,Internet Explorer 8,Footer,Sticky Footer,如果您在Firefox中查看,您将看到底部页脚在调整大小、移动等操作时与窗口保持一致。它也从底部开始,没有滚动条。然而,在IE8中,我无法让它在开始时坐在底部,或者随着窗口移动,可能还有许多其他问题。我从那里得到了代码,它说它与IE兼容,所以我一定是做错了什么。我不得不稍微修改代码以适应我的情况,但以下是IE特有的css: * { margin: 0; } #container{ min-height: 100%; height: auto !important; height: 100%;
* {
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…我不确定,但它可能是
填充顶部:5px代码>导致问题的原因。尝试更改边距:0自动-30px代码>至边距:0自动-35px
并查看是否有帮助。在您的#容器中
添加
并添加位置:相对代码>到#容器
,因为负边距对静态定位的元素不起作用