2009-09-08 35 views
5

我使用的是粘页脚不可点击状中描述:Link在粘页脚在Firefox和Chrome

我有,我想一个链接一个段落在页面的底部,所以我把它放在.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> 

回答

9

解决它,加入了现在的位置是:相对和Z-指标做到了:

.push, .footer { 
    height: 90px; 
    position: relative; 
} 
.push { 
    z-index: 9000; 
    position: relative; 
} 
.footer { 
    background: #181f18 url(../images/background-top.png) no-repeat center bottom; 
    z-index: 9999; 
    position: relative; 
} 
+2

是跨浏览器兼容的推动和页脚类也需要相对的z-index的位置得到认可。 – 2009-09-19 14:42:15

+0

请用奥斯汀的评论更新您的答案。它真的为我节省了很多时间。 – 2013-09-22 20:29:24

+0

@Johnny_D好点,我添加了它。 – jeroen 2013-09-23 05:30:50

1

我在webkit浏览器中遇到了类似的问题。设置z-index或位置并不能解决问题,但在设置-webkit-transform后:translate(0,0);该按钮可以再次点击。

0

纠正我,如果我错了,但我认为你应该添加一个负值z-index推回它启用链接按钮。

这为我工作

.footer, .push { 
    height: 4em; 
    position: relative; 
    width: 90%; 
    margin: 0 auto; 
    z-index: -9000; 
}