我是网页开发的新手.所以,请耐心等待.我使用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>