twitter-bootstrap Twitter Bootstrap - 使页脚全宽

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13838482/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 15:54:13  来源:igfitidea点击:

Twitter Bootstrap - Making footer run full width

csstwitter-bootstrap

提问by user1554264

I'm trying to make my footer run the whole width of the web page like the navigation, however I want to centre the content of the footer inline with the content above.

我试图让我的页脚像导航一样运行整个网页的宽度,但是我想将页脚的内容与上面的内容内联居中。

<footer>
    <div class="container narrow">
       <div class="row-fluid footer">
          <div class="span4">
          </div>
          <div class="span3">
          </div>
          <div class="span5">
          </div>
       </div>
    </div>
</footer>

I thought that adding the classes <div class="container narrow">inside the footer would centre the content but this has not worked. Any ideas?

我认为<div class="container narrow">在页脚中添加类会使内容居中,但这并没有奏效。有任何想法吗?

The site is available here - http://www.openreachmarketing.co.uk/

该网站可在此处访问 - http://www.openreachmarketing.co.uk/

回答by jfrej

You have the footer background defined in the .footerclass. So you need .footerto wrap around .container.narrow.

您在.footer类中定义了页脚背景。所以你需要.footer环绕.container.narrow.

This works when I try:

这在我尝试时有效:

<footer>
    <div class="footer">
       <div class="container narrow row-fluid">
          <div class="span4">
          </div>
          <div class="span3">
          </div>
          <div class="span5">
          </div>
       </div>
    </div>
</footer>