我正在使用 jQuery 菜单幻灯片,但页脚有一些问题。
当我放大时,我的页脚与所有其他内容重叠。结果是,如果您以较小的分辨率查看网站,您将无法获得所有内容。
我尝试删除绝对位置,但随后页脚转到屏幕顶部。
我需要我的页脚始终位于我的内容下方,无论内容的高度是多少。
这个脚本可以实现吗?
网站:http://kennethkjaer.gofreeserve.com/
#footer {
/* Footer container (whole browser width) */
background-image:url(../images/footer_bg.jpg);
bottom: 0;
position:absolute;
width: 100%;
height:85px;
padding-top:10px;
padding-bottom: 5px;
}
#footer_box {
/* Centered footer container with som padding to align properly the content */
width: 820px;
height:30px;
margin:0px auto;
position: relative;
padding:0px 10px 0px 10px;
}
#footercontent {
width: 360px;
height: 30px;
float: left;
padding: 0px;
}
#footerimg {
width: 100px;
height: 30px;
margin: 0px;
float: left;
}
#footerimg p {
float: right;
margin: 38px 0px 0px 0px; !important;
}
最佳答案
根据您的问题,我假设您不想要粘性页脚。
在这种情况下,是 position:absolute
和 bottom:0
导致了问题。您告诉页脚始终粘在底部(浏览器窗口的底部,而不是文档的底部),即使其他内容也到达那里。因此,当网页上的其他内容到达浏览器窗口的底部时,它就会被页脚覆盖。如果你删除这个CSS,这个问题就可以解决。如果 HTML 的页 footer 分位于页面 HTML 的末尾,那么它自然会位于(文档的)底部,但您可能需要向下滚动才能看到它,因为它赢了不再停留在浏览器窗口的底部。
看看this website以供引用。我假设这就是您想要的页脚。
关于jquery - 页脚重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9513818/