dh7*_*762 5 html css sticky-footer
我的内容与我的页脚重叠(粘性).但它应该有一个普通的填充顶部.我如何使用CakePHP(不相关)和Twitter Bootstrap.在某些页面上它可以工作,而在其他页面上则不然 我怎样才能解决这个问题?
CSS
body {
padding-top: 60px;
}
.sidebar-nav {
padding: 9px 0;
}
html, body {
height: 100%;
}
footer {
padding: 17px 0 18px 0;
border-top: 1px solid #000;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -63px;
}
.push {
height: 63px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="container-fluid wrapper">
<div class="row-fluid">
<div class="span11">
//content
</div>
</div>
</div>
<footer class="footer">
<div class="container-fluid">
<div class="row-fluid">
<div class="span8">
</div>
<div class="span4">
<div class="footer-links pull-right>
//content
</div>
</div>
</div>
</div>
<div class="footer-floor">
<div class="container-fluid">
//content
</div>
</div>
</footer>
Run Code Online (Sandbox Code Playgroud)
为了使粘性页脚正常工作,您必须设置 和 的.push高度.footer。尝试将63px高度添加到页脚中。
.push, footer {
height: 63px;
}
Run Code Online (Sandbox Code Playgroud)