jer*_*oen 5 html css firefox webkit
我正在使用如下所述的粘性页脚:
我有一个带有链接的段落,我希望它位于页面底部,所以我把它放在.footer中.
问题是该链接在Firefox 3.5.2和Chrome中无法点击,它位于.push后面.它确实在IE7和IE8中工作,但我想这并不多说.
我玩过z-index,但这不起作用.顺便说一句,我需要位置:#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;
}
Run Code Online (Sandbox Code Playgroud)
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>
Run Code Online (Sandbox Code Playgroud)
解决了它,添加了一个位置:相对和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;
}
Run Code Online (Sandbox Code Playgroud)