为什么我的页脚不粘?

时间:2012-09-27 13:56:18

标签: html css footer

我想将页脚粘贴到页面的最底部,没有间距,所以在每个屏幕上都显示相同的内容。

目前的情况如下:

http://www.slyfiles.com/login.php

页脚代码:

<div class="footer">
<div class="container">
<span id="footer"> &copy; 2012 SlyFiles &nbsp;<a href="#">About</a>  &nbsp<a     href="#">TOS</a>  &nbsp<a href="#">DMCA</a>  </span>
</div>
</div>

和CSS:

.footer {
background: #1d1d1d;
width: 100%;
height: 32px;
border-top: solid 10px #017cc5;
margin-top: 5px;
}

为什么不坚持到底?

谢谢!

3 个答案:

答案 0 :(得分:1)

将此添加到.footer的CSS:

position: fixed;
bottom: 0;

答案 1 :(得分:0)

答案 2 :(得分:0)

添加明确:两者也是。

.footer{
clear:both;
}

我已关注http://www.cssstickyfooter.com/

相关问题