将div放在页面底部

时间:2012-04-26 23:43:38

标签: css

我有一个我正在http://s361608839.websitehome.co.uk/testsite/

工作的网页

基本上div #footer应该位于页面底部,因为它位于标记的末尾,它也在#wrapper之外。

HTML:

 <div id="footer">This footer text should be underneath the white box (at the bottom)</div>

CSS:

#footer{
width: 960px;
margin: 0 auto;
color: #FFF;
}

我尝试在CSS中添加一个clear:both因为我认为页面中的某个浮动可能会导致这种情况,但它似乎没有做任何事情。

任何帮助表示赞赏。

由于

1 个答案:

答案 0 :(得分:2)

将你的#header位置改为亲戚并删除#register上的'top'声明,一切都很好!

绝对定位会对页面流量造成严重破坏,因此在使用它时请记住这一点!