页脚未延伸至网站页面底部
我最近几天一直在阅读,但还没有解决方案。
我正在用普通的旧 html 编写一个网站,页脚似乎不想延伸到页面底部。我一直在无休止地测试,但仍然没有结果。
这是代码片段。
<div id="footer">
<div id="footer_content">
<p> © 2011 KRG Maintenance - All Rights Reserved - Contact Us</p>
</div> <!--footer content ends-->
</div> <!--footer ends-->
</body>
</html>
body{
position:relative;
background:#383d43 url(../images/body_bg.jpg) repeat-x;
color:#000;
font:62.5% Myriad Pro,Arial,sans-serif;
}
#footer{
width: 100%;
float: left;
clear: both;
height: 100%;
background-color: #ffffff;
background: #1e2329 url(../images/footer_bg.jpg) repeat-x;
}
#footer_content{
margin: auto;
width: 943px;
padding: 17px 17px 0px 0px;
}
我将页脚延伸到页面底部,但它只是悬挂在其下方的空白区域。 我在这里真的很困惑,似乎其他解决方案没有解决这个问题。 任何帮助将不胜感激。
Possible Duplicate:
How to force a DIV block to extend to the bottom of a page, even if it has no content?
I been reading for the last few days but yet no solution.
I am writing a website in plain old html and it appears the footer does not want to extend to the bottom of the page. Ive been testing endlessly but still no result.
Here is the code snippet.
<div id="footer">
<div id="footer_content">
<p> © 2011 KRG Maintenance - All Rights Reserved - Contact Us</p>
</div> <!--footer content ends-->
</div> <!--footer ends-->
</body>
</html>
body{
position:relative;
background:#383d43 url(../images/body_bg.jpg) repeat-x;
color:#000;
font:62.5% Myriad Pro,Arial,sans-serif;
}
#footer{
width: 100%;
float: left;
clear: both;
height: 100%;
background-color: #ffffff;
background: #1e2329 url(../images/footer_bg.jpg) repeat-x;
}
#footer_content{
margin: auto;
width: 943px;
padding: 17px 17px 0px 0px;
}
I was the Footer to extend to the bottom of the page, yet instead it just hangs with white space below it.
I am really puzzled here and it appears other solutions have no fixed it.
Any help will be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Robert Harvey 的第一个链接看起来不错:确保主体本身足够大,以允许
执行您想要的操作。
因此,
body
的height: 100%
应该可以帮助您。Robert Harvey's first link looks good: make sure the body itself is large enough to allow the
<div>
to do what you want.So,
height: 100%
for yourbody
should help you out.