【发布时间】:2014-07-24 16:11:28
【问题描述】:
我无法在页面底部设置页脚。我已经阅读了数十篇教程,但仍然有问题。在内容覆盖整个窗口的页面中,页脚被粘在底部没有问题。但在内容不多的页面中,页脚位于页面中间。
<html><body>
text here text here
<footer id="footer">
Im in the footer and bottom of the page!
</footer>
</body></html>
body {
background: url('/static/img/bg.png');
min-width: 1300px;
height: 100%;
}
footer {
clear: both;
padding-top:20px;
padding-bottom:20px;
background-color:#222;
margin-top: 15px;
color: white;
text-align: center;
}
我曾尝试在页脚中添加position:absolute 或position:fixed 和bottom:0px,但结果最差。页脚后有一个空格。
【问题讨论】:
-
我真的很喜欢 Stuart Nicholls 的这个:cssplay.co.uk/layouts/basics2.html