固定在窗口底部
不會(huì)隨內(nèi)容滾動(dòng)而消失。
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
...
</div>
</nav>
body {
/* Default height of navbar is 50px *
padding-bottom: 70px;
}
固定在頁(yè)面底部
粘在內(nèi)容底部,內(nèi)容未撐滿窗口時(shí)則粘在窗口底部。
<footer class="footer">
<div class="container">
...
</div>
</footer>
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 50px;
background-color: #f5f5f5;
}