我有一个网站(它实际上是我的课程的作业),其页脚固定在页面底部,其中:
position: absolute;
bottom: 0;
但是站点中有一个页面的内容位于屏幕底部下方,并且页脚位于屏幕底部而不是位于内容下方。所以,当内容适合一个屏幕时,我需要我的页脚停留在屏幕底部,而当内容超出屏幕大小时,我需要位于内容下方。我已经尝试了所有这些:
clear: both - on wrapper and content (already on footer)
position: relative, static, fixed
min-height - didn't change anything
height: 100%
overflow: hidden
vertical-align: all values plus a length
我还尝试仅在该页面上为页脚使用单独的 id。但我无法让它工作。