我对网页开发有点陌生。所以,请耐心听我说。我使用 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/