【问题标题】:Remove space below footer?删除页脚下方的空间?
【发布时间】:2013-12-07 06:42:34
【问题描述】:

有没有办法删除页脚下方的空白:- http://getbootstrap.com/examples/sticky-footer-navbar/

我已经通过添加 {position:fixed;width:100%} 解决了这个问题,但它只适用于几页。对于其他页面,页脚根本不会出现。我也读过这个,但它似乎不起作用:Can't remove Whitespace at the bottom of my document

谁能解释一下这里的错误是什么?

【问题讨论】:

  • 您的链接在 Chrome 中适用于我,您使用的是什么浏览器/版本?
  • chrome 版本 31.0 linux 版本
  • 如果更改页脚的颜色,后面应该有一些空白或背景。
  • 抱歉,该链接适用于 Chrome 33、IE8-11 以及 Windows 上最新的 Safari 和 Firefox。页脚位于屏幕底部,直到它与内容相遇,此时它仍位于内容下方并显示滚动条。我认为这是预期的行为。
  • 谢谢,我认为这是浏览器或扩展程序问题。

标签: html css twitter-bootstrap


【解决方案1】:

我曾经在使用 bootstrap 时遇到过同样的问题 我使用这个 css 将页脚粘贴到页面底部:

    *{
     margin: 0;
     }

     .wrapper{
     min-height: 100%;
     height: auto !important;
     height: 100%;
     margin: 0 auto -0em;
     }

     .footer, .push{
     height: 2em;
     }

     .footer, .push{
     clear: both;
     }

把所有的内容放在wrapper类中,使用wrapper下面的footer类。 当我遇到这个问题时,我在某个地方找到了它并且它有效。

【讨论】:

  • 您能转到我提供的第一个链接,看看页脚下方是否有空间吗?并让我知道您的浏览器版本。
  • 我没有看到任何空间。使用谷歌浏览器版本 31.0.1650.63 m
  • 谢谢,我认为这与我的扩展脚本之一有关。