我的<footer>不会停留在页面底部</footer>

时间:2013-01-29 05:30:33

标签: css html5

我的<footer>标记似乎不会停留在我的页面底部。我已经尝试了几种不同的技术来修复它,但没有一种技术可以解决。

我已在下面的工作网站中添加了链接。

http://stage.bmdigitalgroup.com/recipes.html

2 个答案:

答案 0 :(得分:0)

根据您的屏幕截图,您的显示器高度看起来比您网站的内容大,或者您已经缩小了很多,所以您看到的是完全正常的。在较小的显示器中,它看起来很好。您可以向站点容器添加min-height:规则,以便将页脚向下推到指定值,但是您需要找出对您和您的用户有意义的最小高度。

如果您真的想让页脚始终贴在底部而不管显示器的高度或缩放级别如何,那么您可以添加以下规则 - 请记住,在内容不多的页面中,您如果需要访问页脚,最终会强制用户无缘无故地向下滚动:

/* 
 This rule is already in your stylesheet. 
 I added it here just for reference. 
*/
html, body {
  height: 100%;
}

/* 
  This is the container that holds your whole site. 
  You should use an id like "#container" or "#site" so this rule 
  applies only to your site's main container. 
*/
.container_12 {
  min-height: 100%;
}

答案 1 :(得分:0)

我想你想把你的页脚放在页面的底部我有任何解决方案,如果我是对的,那么就是答案。

.footer {
position:absolute;
border:0px;
}

了解更多提示,技巧和教程访问 - blog.klassicweb.com