html - 类似谷歌的全宽粘性页脚

标签 html css twitter-bootstrap

我正在尝试创建一个页脚,就像谷歌在其主页底部使用的那样。它将是页面的全宽,两侧都有链接。但是,我想在中心拥有版权。

这是我用来完成此任务的默认布局:http://jsfiddle.net/304gvLyn/

但是,页脚包含在 container 中,因此它不会跨越页面的整个宽度。

<footer class="footer">
  <div class="container">
      <p class="text-muted pull-right">Button Here</p>
  </div>
</footer>

如果我把它变成 container-fluid 那么就没有填充,它有时会创建一个水平滚动条。

这是它目前的样子:

enter image description here

这就是我想要做的: enter image description here

最佳答案

Bootstrap 容器设计用于行和列。

<footer class="footer container-fluid">
    <div class="row">
        <div class="col-xs-2">
            <p class="text-muted pull-right">Button Here</p>
        </div>

        <div class="col-xs-8 text-center">
            <p>Copyright Here</p>
        </div>

        <div class="col-xs-2">
            <p class="text-muted pull-right">Button Here</p>
        </div>
    </div>
</footer>

Demo

关于html - 类似谷歌的全宽粘性页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32638819/

相关文章:

jquery - Bootstrap - jQuery 未定义

html - 为什么 `transform` 会中断 `position: fixed` ?

html - bootstrap 4 中的自定义卡片组

javascript - 如何替换html中的doctype?

html - 连续第 4 个子元素的单独 css

javascript - 很奇怪;当 $(this).width() 被调用时包含元素改变大小

css - 使用 padding-bottom 方法规范化列高度会导致使用名称 anchor 出错

javascript - 如何在 iframe 中设置动态创建的元素的样式?

php - 更改 <td> 的背景而不向 <td> 添加类

html - 如何将水平条转换为响应式?