底部最小高度的页脚

footer at bottom min-height

我一直在对我兄弟的网站进行一些更改,我想把页脚放下来..(一开始就应该这样做..)

但它不会下降,我已经尝试了我知道的所有基本技巧,但由于某种原因它不会下降。我想我错过了什么或做错了什么。

谁能帮帮我!因为我有一个狭隘的视野,我没有看到我犯的错误。

Website

如果你需要什么,我会post它!

提前致谢!

您可以使用 Sticky Footer。将您的内容包装在 div 中,但不包括页脚脚本:

<div class="page-wrap">
   ALL Content

</div>

<footer>
  //footer script
</footer>

然后在 CSS 中为页脚设置高度,并使用相同的值作为包装和 :after 选择器的负边距:

html, body {
  height: 100%; //make sure you add this
}

.page-wrap {
  min-height: 100%;
  /* equal to footer height */
  margin-bottom: -100px; 
}

.page-wrap:after {
  height: 100px; 
  content: "";
  display: block;
}

footer {
  height: 100px; 
}