Can anyone give me a hint why the link in the gray box is not clickable in Internet Explorer (I'm using version 11).
http://jsfiddle.net/rk7n7xjj/1/
I tested it in any other browsers and it works fine.
HTML
<div class="gray"><a href="#bla">This link is not clickable in IE</a></div>
<div class="yellow">Some placeholder text</div>
CSS
.gray {
position:fixed;
z-index:-1;
top:100px;
background:gray;
height:50px;
width:200px;
}
.yellow {
margin:0 auto;
background:yellow;
height:1000px;
margin-top:400px;
}
The link is not clickable becaue of the
z-index
. Actually you setting thediv
behind thebody
. You must specify thez-index
of thebody
too. Or at least set it positiv so it's in front of thebody
and set other elemnts higher if you expact to display them in front of the graydiv
. Thats why you cant click it. Obviously Firefox and co has no problems to identify the link when you setz-index
like this.This may helps you to understand how you can use
z-index
also in IE.In your case, to get what you want, your
CSS
should look like:Actually you dont need the
z-index
on the gray in your case but if you plan to may display something behind the graydiv
than you may need it.