【发布时间】:2010-11-26 13:33:59
【问题描述】:
我正在使用如下所述的粘性页脚:
- How do you get the footer to stay at the bottom of a Web page?
- http://ryanfait.com/resources/footer-stick-to-bottom-of-page/
我有一个带有链接的段落,我想放在页面底部,所以我把它放在 .footer 中。
问题是该链接在 Firefox 3.5.2 和 Chrome 中不可点击,它位于 .push 后面。它在 IE7 和 IE8 中确实有效,但我想这并不能说明什么。
我玩弄过 z-index,但这不起作用。顺便说一句,我需要 #page 中的 position:relative 来在该 div 中放置一些东西。
有没有办法让 .footer 中的链接在所有浏览器中都可点击?
代码的相关部分:
css
html, body {
height: 100%;
}
#page {
width: 962px;
text-align: left;
min-height: 100%;
/* sticky footer part */
height: auto !important;
height: 100%;
margin: 0 auto -90px;
/* end sticky footer */
position: relative;
}
/* sticky footer part */
.push, .footer {
height: 90px;
}
.push {
}
.footer {
background: #181f18 url(../images/background-top.png) no-repeat center bottom;
}
html
<div id="page">
<div id="wrapper">
<div id="contents">bla bla</div>
</div>
<div id="footer">bla bla</div>
<div class="push"></div>
</div>
<div class="footer">
<p><a href="http://www.some-site.com/">Some Text</a></p>
</div>
【问题讨论】: