我使用的是粘頁腳不可點擊狀中描述:Link在粘頁腳在Firefox和Chrome
- 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指標,但那不起作用。順便說一句,我需要的位置:在#page中的相對位置在該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>
是跨瀏覽器兼容的推動和頁腳類也需要相對的z-index的位置得到認可。 – 2009-09-19 14:42:15
請用奧斯汀的評論更新您的答案。它真的爲我節省了很多時間。 – 2013-09-22 20:29:24
@Johnny_D好點,我添加了它。 – jeroen 2013-09-23 05:30:50