【发布时间】:2012-03-05 10:18:33
【问题描述】:
这里是新手编码器。我一直在尝试在我的网站上实现一个粘性页脚,但它根本不起作用。基本上,它是一个图像,上面有一些绝对定位的文本。这是我的网站:http://mc-airlines.hostei.com
如您所见,它绝对行不通!
我正在使用这个:http://ryanfait.com/resources/footer-stick-to-bottom-of-page/ 来做到这一点。这是与我网站页脚相关的代码:
* {
margin: 0;
}
body, html {
text-align:center;
border-width: 0px;
margin:0;
padding:0;
height:100%;
}
#container{
position:relative;
margin: 0 auto -175px;
width:960px;
min-height:100%;
height: auto !important;
text-align:left;
}
#footer{
margin: 0 auto;
text-align:left;
width:960px;
height:175px;
}
#links {
font-family: 'HelveticaNeueRegular', Trebuchet MS, Verdana, sans-serif;
color:white;
font-size: 18px;
padding: 10px;
position: absolute;
bottom: 23px;
left: 0;
width: 300px;
}
#links2{
font-family: 'HelveticaNeueRegular', Trebuchet MS, Verdana, sans-serif;
color:white;
font-size: 18px;
padding: 10px;
position: absolute;
bottom: 10px;
left: 310px;
width: 420px;
}
还有我的html:
<div id="container">
<!-- (site content -->
<div class="push"></div>
</div>
<div id="footer">
<img src="images/footer.png" alt="footer" class="foot"/>
<div id="links">
<script type="text/javascript">copyright=new Date();
update=copyright.getFullYear();
document.write("© "+ update + " MC Airlines");</script><br>
<span class="psmall">
All content on this site belongs to MC Airlines and its subsidiaries, and may not be used without prior permission from Mr MC. Just kidding, he probably won't reply - just don't abuse it too much :) </span>
</div>
<div id="links2">
Other Links <br>
<span class="psmall">
<a href="">Our Partners</a><br>
<a href="">MC Airlines Thread</a><br>
<a href="">MC Airlines Wiki</a><br>
<a href="">Cyber Airlines</a><br></span>
<span class="pxsmall">
We can not be held responsible for the content on external sites. I mean c'mon, that's just unfair.
</span>
</div>
<!-- #footer close -->
</div>
如果有人能指出我做错了什么,我将不胜感激。
谢谢!
【问题讨论】:
标签: css sticky-footer