Can’t make links (appear ) clickable in IE
We all know that Internet Explorer hasn’t been the best of the bunch rendering CSS properly, and while IE 7 got better, it’s far from perfect. I have an example here where I can’t make links (appear) clickable, no matter what.
The scenario
The scenario is easy and fairly common: I have a sidebar-navigation which will contain a number of images and interaction, so I need an extra element to hook into. My HTML code looks like this:
<ul>
<li>
<a href="/"><span>Da root</span></a>
</li>
</ul>
And this is the CSS applied:
a {
display: block;
}
span {
display: block;
height: 20px;
}
The problem
As long as the span has a specified height, or in any way gains hasLayout state (through float, height: 1%; or zoom: 1;), there will not be a cursor when you hover over it. Most of the times, though, it remains clickable and behaves like a link.
I tried any different hasLayout solution to this, adding background-color to the link since I know that solved similar problems in IE before, went crazy with position: relative, but nothing works!
Affected web browsers
This problem can be experienced in Internet Explorer 6 as well as Internet Explorer 7.
The challenge
Make this work! Show me that you’re smarter than me (hell, you have to be smart since you read this blog, right?
)!
Download the test file and play around with it, see if you have any idea why this happens and, more importantly, what to do about it.
Go!
PS. Suggestions adding cursor: pointer to the span element will be completely disregarded.
DS.






