Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link in sticky footer not clickable in Firefox and Chrome

I am using a sticky footer like described in:

  • 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/

I have a paragraph with a link that I want to be at the bottom of the page, so I put it in .footer.

The problem is that the link is not clickable in Firefox 3.5.2 and Chrome, it is behind .push. It does work in IE7 and IE8 but I guess that doesn´t say much.

I have toyed around with z-indexes but that does not work. By the way, I need the position:relative in #page to position some stuff inside that div.

Is there a way to make a link in .footer clickable in all browsers?

The relevant parts of the code:

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>
like image 795
jeroen Avatar asked Sep 08 '09 16:09

jeroen


2 Answers

Solved it, adding a postion:relative and z-indexes did it:

.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;
}
like image 189
jeroen Avatar answered Sep 17 '22 23:09

jeroen


I had similar problem in webkit browsers. Setting the z-index or position didn't solve the problem but after I set -webkit-transform:translate(0,0); the button is clickable again.

like image 22
5566 Avatar answered Sep 18 '22 23:09

5566