简体   繁体   English

页脚 <div> 滚动时不停留在页面底部-CSS和HTML

[英]Footer <div> not staying at bottom of page when I scroll - CSS & HTML

My footer is not all the way on the bottom. 我的页脚并不是一直都在底部。 It should be the very last thing on the bottom of page below the fold. 它应该是折叠下面页面底部的最后一件事。 All I need is to have a footer at the bottom of page, not the bottom of screen. 我所需要的只是在页面底部而不是屏幕底部有页脚。

You can see it here: http://bit.ly/zftRi3 您可以在这里看到它: http : //bit.ly/zftRi3

Remove position: absolute; 移除position: absolute; from <div id="footer"> . 来自<div id="footer"> Since your footer is after all your other HTML, that is the default behavior. 由于页脚位于所有其他HTML之后,因此这是默认行为。

Demo: http://jsfiddle.net/ThinkingStiff/NwdGN/ 演示: http//jsfiddle.net/ThinkingStiff/NwdGN/

position: absolute更改为position: fixed

将页脚从position:absolute !important更改为position:relative ,它应该随页面移动到底部。

Try this: 尝试这个:

#page-container {
    margin: 0 auto;
    overflow: hidden;
    width: 999px;
}

#footer {
    background: url("../../skin/fashion_mosaic_grey/css/../images/fashion_mosaic/horiz_separator.gif") repeat scroll left top transparent;
    clear: both;
    height: 68px;
}

Edit: 编辑:

Remove the bottom property of .footer and it works. 删除.footerbottom属性,它可以工作。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM