aqxxqa
Last Updated: February 25, 2016
·
4.26K
· cub3

IE a > span won't trigger right click link menu

Wow this took me some time to get through, have been doing a lot of IE7-10 testing recently and finding crazy bugs like these seems to have become the norm.

The newest seems to be an Internet Explorer 7-10 bug involving having a span tag within an anchor eg.

<a href='#'>
    <span>Super cool link</span>
    <span>10</span>
</a>

In IE, you seem to be able to left click through but you cannot right click on the item and get the link menu, this problem seems to be persistent across Google's services too, eg.

Picture

After alot of fiddling around with z-indexes and trying to fill the anchor with a few  's

I found the issue is if you have anything other than display: inline; on the span it won't work.

ie.

<a href="#" title="Link">
    <span style="display:block;">This does not work</span>
</a>

<br />

<a href="#" title="Link">
    <span style="display:inline;">This should work</span>
<a>

As per why this happens? I have no idea but at least I have a soultion for it.

I hope this will help someone in the future to spend alot less time on this issue than I did.