我想将页脚放在页面底部

时间:2019-05-13 16:42:29

标签: html css

我有一些页面的内容太少了,页脚上升了,我已经修复了,但是现在页脚在我的页面内容中,用于包含更多内容的页面

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" />


<footer class="mt-5 footer bg-dark text-white" style="
   margin-top: 100px;   
   position:absolute;
   bottom:0;
   width:100%;
">
  <div class="container">
    <div class="row p-4">
      <div class="col text-center">
        <a href="#" class="twitter"><i class="fab fa-twitter fa-3x mr-4"></i></a>
        <a href="#" class="facebook"><i class="fab fa-facebook fa-3x mr-4 "></i></a>
        <a href="#" class="google"><i class="fab fa-google-plus fa-3x mr-4"></i></a>
      </div>
    </div>
  </div>
</footer>

enter image description here

1 个答案:

答案 0 :(得分:2)

将页脚放入内部并赋予其以下样式

.container{
    position:relative;
    min-height:100vh;
}
footer{
    position:absolute;
    bottom:0;
    width:100%;
}
相关问题