【发布时间】:2013-10-23 20:43:11
【问题描述】:
可能重复:
How to force a DIV block to extend to the bottom of a page, even if it has no content?
这几天我一直在阅读,但还没有解决方案。
我正在用普通的旧 html 编写一个网站,并且页脚似乎不想扩展到页面底部。我一直在测试,但仍然没有结果。
这里是代码sn-p。
<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;
}
我是延伸到页面底部的页脚,但它只是挂在下面的空白处。 我在这里真的很困惑,似乎其他解决方案没有解决它。 任何帮助将不胜感激。
【问题讨论】:
-
感谢罗伯特·哈维。我昨天试过了,没有成功。出于某种原因,它现在可以工作了:S
-
“我昨天试过了,但没有成功。由于某种原因它现在可以工作了”——哇,我们都知道那种感觉吗。