jquery - 页脚(导航栏)与侧边栏不相关

标签 jquery twitter-bootstrap-3

我对网页开发有点陌生。所以,请耐心听我说。我使用 Bootstrap 3 中的导航栏制作了网站的页脚。

显然,我需要将页脚保留在页面底部。我的网格系统为 2 8 2。现在,页脚非常适合中间网格,即 col-8。但右列却惨遭失败。

页脚:

<div class="footer navbar navbar-default navbar-fixed-bottom">
    <div class="container">
        <p class="navbar-text pull-left"> Footer</p>
    </div>
</div> 

CSS:

.footer { 
    position:relative;
    background-color:#ccffcc;
    color: white; 
}

.container { 
    width: auto;
    max-width: 680px;
    padding: 0 15px;
    height:auto;
}

有问题的场景: Please look at the right side of the page. The footer's misbehavior with the sidebar....so to speak.

最佳答案

看看bootstrap sticky-footer举个例子。

在你的 html/css 中你必须添加:

CSS:

* {
    margin: 0;
}
html, body {
    height: 100%;
}
.wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
    height: 155px; /* .push must be the same height as .footer */
}

HTML:

<div class="wrapper">
  <p>Your content.</p>
  <div class="push"></div>
 </div>
 <div class="footer">
   <p>Copyright</p>
 </div>

关于jquery - 页脚(导航栏)与侧边栏不相关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35429514/

相关文章:

jquery - 事件管理 - 根据第一个下拉菜单的选择刷新第二个下拉菜单 (Rails 3.2)

html - 如何在 Mithril.js 中获取浏览器高度以进行动态分配

html - Bootstrap 输入组 1px 差异

html - 菜单中的图像位置幻灯片

html - 使用 col-push 和 col-pull bootstrap 定位元素 3

jquery - 如何使用 Jquery 动态并排添加 Div?

javascript - 如何嵌套一组项目,将它们除以第一个值?

html - 如何避免 float 元素和高度上的 div 换行

jquery - 使用高亮filterData在全局变量上不显示过滤器数据意味着不在Typescript中的功能

javascript - 在 jQuery DataTables 中的所有行前面放置一个按钮