如何在我的网站底部固定该页脚?页面链接:http://grillosolutions.ch/news/

时间:2018-11-14 15:19:52

标签: html css

此刻我的身体和页脚的CSS代码:

我只是无法在页面底部修复页脚。我阅读了很多有关www的解决方案,但对我来说都没有用。感谢您的帮助!

body {
  background: #ffffff;
  color: #737f85;
  font-family: "Tahoma", Tahoma, Arial, sans-serif;
  font-size: 100%;
  line-height: 25px;
  font-weight: 400;
  padding: 0;
}


.footer-sidebar {
  background-color: #ccff66;
  margin: 0;
  padding: 55px 0 0px;
  width: 100%;
  height: 100%;
  text-align: justify;
}

2 个答案:

答案 0 :(得分:0)

您可以将演示代码放在codepen.io上吗?

无论如何,您可以尝试执行以下操作以使页脚始​​终停留在底部:

body {
      background: #ffffff;
      color: #737f85;
      font-family: "Tahoma", Tahoma, Arial, sans-serif;
      font-size: 100%;
      line-height: 25px;
      font-weight: 400;
      padding: 0;
      height: 500px; /*remove this, I just put it here to make it clear*/
    }

    .footer-sidebar {
      background-color: #ccff66;
      margin: 0;
      padding: 55px 0 0px;
      width: 100%;
      text-align: justify;
      /*add this*/
      position: fixed;
      bottom: 0;
    }
<div>
  this is some text
</div>

<footer class="footer-sidebar">This is footer</footer>

如果页脚遮盖了身体的一部分,请将padding-bottom: 100px设置为100px作为页脚的高度

答案 1 :(得分:0)

内容部分(页眉和页脚之间的空间)中的内容不足。 指定网站内容部分的高度。

.site-content {
    height: 100vh;
}