粘贴页脚

时间:2010-12-25 03:08:06

标签: html css sticky-footer

我试图让我的页脚贴在本网站页面的底部: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;}

有没有人知道为什么它不坚持到底?

3 个答案:

答案 0 :(得分:4)

我可以告诉你一个更好的选择,在底部修复它

只需将样式应用为

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

谢谢和问候,

<强> Wazzy

答案 1 :(得分:0)

如果它在其他地方都可以使用,那么html页面的内容肯定是错误的,而不是CSS,可能会发布HTML页面代码,或者将它与实际工作正常的内容进行比较。

答案 2 :(得分:0)

查看此链接上的sticky footer tutorial,了解粘性页脚概念的工作原理。这应该可以帮助您比较您的html结构和CSS以找到问题。如果你能给我们你的HTML,我们可以和你一起看看。​​

相关问题