gpt4 book ai didi

html - 无法让页脚停留在页面底部

转载 作者:太空宇宙 更新时间:2023-11-03 18:36:52 25 4
gpt4 key购买 nike

让页脚停留在页面底部有很大的问题。

我决定将代码添加到 pastebin:

这是 css:http://pastebin.com/uf2c7jLX

这是其中一页:http://pastebin.com/qpwz22us

这个问题在整个网站上都是一致的。我做错了什么?

比如有时候会出现这种情况,一些内容被页脚隐藏了:

enter image description here

enter image description here

浏览器 View 底部和页脚之间存在巨大差距。上图还显示页脚与内容重叠。

关于编辑:第二个也不是我想要的。页脚和浏览器底部之间存在巨大差距。我希望页脚位于底部,如果内容太长以至于您必须滚动,那么在您到达页面底部之前页脚不应该可见。谢谢:)

最佳答案

编辑:其实我只是看到你的截图,把绝对定位改成相对就可以了

更改页脚和正文的位置并移除页脚的边距:

body{
margin: 0;
padding: 0;
/*padding-bottom: 60px;*/
width: 100%;
height: 100%;
position: relative;
}

footer{
position: relative;
background: cornflowerblue;
height: 60px;
width: 100%;

}

这是 fiddle http://jsfiddle.net/vFg8j/

另一个有用的资源 - 粘性页脚 http://ryanfait.com/sticky-footer/

关于html - 无法让页脚停留在页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18517349/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com