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 thedivbehind thebody. You must specify thez-indexof thebodytoo. Or at least set it positiv so it's in front of thebodyand 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-indexlike this.This may helps you to understand how you can use
z-indexalso in IE.In your case, to get what you want, your
CSSshould look like:Actually you dont need the
z-indexon the gray in your case but if you plan to may display something behind the graydivthan you may need it.