1

我试图让我的页脚贴在这个网站的页面底部:https ://account.radonsystems.net 。

不幸的是,它似乎不起作用,尽管它在我使用过的其他任何地方都有效。

这是粘性的 CSS:

html, body {height: 100%;}

#wrap {min-height: 100%;}

#main {overflow:auto;
padding-bottom: 57px;}  /* must be same height as the footer */

#footer {position: relative;
margin-top: -57px; /* negative value of footer height */
height: 35px;
clear:both;}

/*Opera Fix*/
body:before {
content:"";
height:100%;
float:left;
width:0;
margin-top:-32767px;/
}    

.footer a,.footer a:hover{text-decoration:underline;color:#FFF;}

有谁知道为什么它不粘在底部?

4

3 回答 3

4

我可以告诉你一个更好的选择来修复它

只需将样式应用为

#footer {
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    width:100%;
    height:57px;
}

谢谢并恭祝安康,

时髦的

于 2010-12-25T03:22:52.340 回答
0

如果它在其他任何地方都可以正常工作,那么该 html 页面一定有问题,而不是 CSS,可能会发布 HTML 页面代码,或者将其与实际正常工作的代码进行比较。

于 2010-12-25T03:25:35.873 回答
0

查看此链接中的粘滞页脚教程,了解粘滞页脚概念的工作原理。这应该可以帮助您比较您的 html 结构和 css 以找到问题。如果您可以给我们您的 html,我们可以和您一起查看。

于 2012-04-10T19:52:13.777 回答