首页 > 解决方案 > 如何使页脚留在页面底部引导程序 4

问题描述

这个问题可能会重复!我希望我的页脚位于页面底部,但在滚动时不会固定在那里。我希望它像本页底部的页脚 Footer Example一样。到目前为止,这是我的页脚代码,我一直在使用 bootstrap 4,但我找不到一个类来帮助我完成我想要的。

<footer>
  <a href="#"><i class="fa fa-facebook"></i></a>
  <a href="#"><i class="fa fa-twitter"></i></a>
  <a href="#"><i class="fa fa-google-plus"></i></a>
  <a href="#"><i class="fa fa-twitch"></i></a>
</footer>

我很清楚引导类

.fixed-bottom但就像我说的,我不希望页脚在滚动时留下。

标签: htmlcssbootstrap-4

解决方案


您可以使用纯 CSS,如下所示:

footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  background-color: #333;
  color:#fff;
}

推荐阅读