【问题标题】:How to set a bootstrap 3 container to 100% of browser height with a sticky footer?如何使用粘性页脚将引导 3 容器设置为浏览器高度的 100%?
【发布时间】:2015-03-01 03:07:03
【问题描述】:

如标题所述,如何使用粘性页脚将引导 3 容器(包装器)设置为浏览器窗口高度的 100%?

BootPly

更新:

粘性页脚工作正常,这是我需要 100% 高度的第一个 '<div class="container">'

【问题讨论】:

标签: css twitter-bootstrap-3


【解决方案1】:

您可以将页面高度设置为 100%,然后将页脚放在底部,并留出高度的边距。

喜欢这里:http://getbootstrap.com/examples/sticky-footer-navbar/

首先将其添加到您的 css 中:

html {
  position: relative;
  min-height: 100%;
}

为页脚添加这个

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px;
  background-color: #f5f5f5;
}

【讨论】:

  • 这解决了粘性页脚 - 有效,问题是关于设置容器的高度,如果你看一下 bootply 示例,它是我需要 100% 高度的第一个容器。
猜你喜欢
  • 2015-02-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-10
  • 2015-01-30
  • 2015-05-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多