有navbar-static-top
navbar-fixed-top
和navbar-fixed-bottom
但是navbar-static-bottom
在Bootstrap中不起作用。有没有办法达到这个效果?
试试这个
HTML
<html>
<body>
<div class="wrapper">
<div class="contents">
<div class="clearfix">
<!-- some contents -->
</div>
</div>
<footer>
<div class="clearfix">
<!-- some contents -->
</div>
</footer>
</div>
</body>
</html>
CSS
html, body {
background-color: #F3F3F3;
height: 100%;
margin: 0;
padding: 0;
}
.wrapper {
position: relative;
min-height: 100%;
}
.contents {
height: 1500px;
}
footer {
background-color: rgb(34, 42, 53);
position: absolute;
bottom: 0; /* absolutely bottom */
width: 100%;
}
.clearfix {
padding: 20px;
}