首页 > 其他 > 详细

bootstrap页脚

时间:2021-04-22 15:30:05      阅读:16      评论:0      收藏:0      [点我收藏+]

固定在窗口底部

不会随内容滚动而消失。

<nav class="navbar navbar-default navbar-fixed-bottom">
  <div class="container">
    ...
  </div>
</nav>
body {
  /* Default height of navbar is 50px *
  padding-bottom: 70px;
}

固定在页面底部

粘在内容底部,内容未撑满窗口时则粘在窗口底部。

<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;
}

参考

bootstrap页脚

原文:https://www.cnblogs.com/lanhuakai/p/14688955.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!