您的位置:首页 > Web前端 > BootStrap

bootstrap:navbar-static-bottom

2020-06-06 06:48 387 查看

botstrap静止在页面底部


第一篇csdn文章

转自https://blog.csdn.net/css_aaa/article/details/82974924

Bootstrap本身提供了navbar-fixed-top 、navbar-fixed-bottom 、navbar-static-top三种方式使用导航条,却无法解决此问题,我们需要navbar-static-bottom。

需要添加的CSS:

<style type="text/css">
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;  width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}
</style>

HTML:

<html>
...
<body>
...
<div class="container">
</div>
...
<footer class="footer">
...页脚内容...
</footer>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: