页脚应保持在底部并保持在固定位置,即使浏览器调整大小也是如此

Footer should stay at the bottom and remain in a fixed position even if the browser resizes

本文关键字:调整 浏览器 位置 底部 定位      更新时间:2023-09-26

我有一个带有几个按钮的页脚,无论上面的内容是什么,或者窗口的大小是多少,它都会停留在页面底部离页面底部60像素的高度……这很好。这是我正在使用的CSS:

#container
{
    min-height: 100%;
    height: 100%;
    position: relative;
}
#footer
{
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 60px; /* Height of the footer */ 
}
#wrap
{
    min-height: 100%;
    max-height: 100%;
}

现在,问题是,如果我调整窗口的大小,容器将变为可滚动的(容器内的所有控件都按预期滚动),但页脚仍然保持在离页面底部60像素的位置,并最终与容器控件重叠。我希望页脚保持在底部,并且只有当我向下滚动到页面底部时才可见。。。希望我清楚这个问题!!!

有人能帮忙吗!!!

@pronay sharma,你可能想要一个粘性页脚。

检查这些链接:

粘贴页脚CSS问题

http://css-tricks.com/snippets/css/sticky-footer/

http://www.cssstickyfooter.com/

CSS Sticky Footer实现的问题