Home > HTML > Named Anchor Issue in IE

Named Anchor Issue in IE

Yesterday I was working on a CSS image map for one of my website and was having issues with internal links in the page in IE. I have started my testing with IE8 and several internal links were not working. The map was working well in all browsers except IE. The most interesting thing was some of the internal links were working in IE too some didn’t.

I knew that I have encountered this issue sometimes back (around 2 years back) but was not able to get the details. My focus was initially to see whether this has anything to do with the image map markup and spent some time to see in that angle. Later I’ve focused my attention to the named anchors used for the internal link purpose.

A typical named anchor markup in my code looks like this

<a name="top"></a>
<a href="#top">Top</a>

It seems that the problem created as the named anchor element does not contain anything within the a tag in IE. Weird, huh. Everything started to work as normal when I changed my named anchor to the following

<a name="top">&nbsp;</a>

IE expects something within the a tag. Once we provide anything in this case a blank space everything will start to work as normal.

Categories: HTML Tags:
  1. September 5, 2013 at 6:12 pm

    Hi there, its good article on the topic of media print, we alll know media is a enormous source of facts.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: