CSS - 将页脚推到页面底部,而不是屏幕底部
CSS - Push footer to bottom of page, not screen
我在我的页面上设置了 this,如果头部 + 内容 + 脚部适合屏幕高度,这就可以正常工作。但是当内容增长时,它会在脚下增长,而不是将脚推到页面底部。
我该如何解决这个问题?
<body>
<div class="head">
Head
</div>
<div class="container">
Content
</div>
<div class="foot">
Foot
</div>
</body>
您可能已经 CSS 这样做了。如果你有这个 HTML 没有标记,那不会发生。
很可能,您有一个看起来像这样的 CSS,需要将其删除。
.foot {
position: fixed;
bottom: 0;
}
我在我的页面上设置了 this,如果头部 + 内容 + 脚部适合屏幕高度,这就可以正常工作。但是当内容增长时,它会在脚下增长,而不是将脚推到页面底部。
我该如何解决这个问题?
<body>
<div class="head">
Head
</div>
<div class="container">
Content
</div>
<div class="foot">
Foot
</div>
</body>
您可能已经 CSS 这样做了。如果你有这个 HTML 没有标记,那不会发生。
很可能,您有一个看起来像这样的 CSS,需要将其删除。
.foot {
position: fixed;
bottom: 0;
}