我的粘性页脚在所有需要 Safari 和 Chrome 的浏览器中都能很好地工作,尤其是 work.html 页面本身。
http://obliqueinteractive.com/creative/work.html
我注意到,当我从样式表中删除此 css 属性时,问题消失了,但不允许页脚再粘贴
html, body {height: 100%;}
是否还有其他 css 问题迫使页脚以这种方式行事?
我的粘性页脚在所有需要 Safari 和 Chrome 的浏览器中都能很好地工作,尤其是 work.html 页面本身。
http://obliqueinteractive.com/creative/work.html
我注意到,当我从样式表中删除此 css 属性时,问题消失了,但不允许页脚再粘贴
html, body {height: 100%;}
是否还有其他 css 问题迫使页脚以这种方式行事?
粘性页脚和带填充的 div 的代码:
body{
background-image: url(../images/main_bg.jpg);
background-repeat: repeat-x;
}
#wrapper{
width: 961px;
margin: 0 auto;
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -104px;
}
.footer, .push {
height: 104px;
}
#work_colm{
width: 675px;
float: left;
display: inline;
padding-bottom: 40px;
}
#footer {
margin: 0 auto;
background: #292929 repeat-x;
height: 104px;
clear: both;
}
首先,很难在没有看到您的代码的情况下进行诊断。是的,肯定还有其他 css 问题会影响粘性页脚;即填充其他元素。同样,当我们看不到您的代码时很难诊断。
这个粘性页脚很棒,我经常使用它。
我做了以下更改(对浮动页脚元素),它现在可以在 safari、opera、firefox 和 chrome 中使用。
width: 101%;
margin-left: -8px;
我不确定 8px 是否只是对我的修复或对所有人的修复,但试一试,让我知道