Aaron Li's Blog

Write it down before I forget

  Home  |   Contact  |   Syndication    |   Login
  30 Posts | 0 Stories | 21 Comments | 1 Trackbacks

News

Google

Archives

Other's Idea

Generally, the following code can lead the hyper link to a named anchor

<a name="aMyGoTo"></a>
<a href="#aMyGoTo">go to the defined point</a>

However, in IE, sometimes it seems the named anchor doesn't work. Here is the solution.

To replace
<a name="aMyGoTo"></a>
with
<span style="position:absolute;"><a id="aMyGoTo">&nbsp;</a></span>

In the case a div or other tag  with style sheet coming right after the <span>named anchor</span>, a more secure way is put a <div> tage outside of the span.  

<div><span style="position:absolute;"><a id="aMyGoTo">&nbsp;</a></span></div>
posted on Friday, January 25, 2008 12:34 PM

Feedback

# re: Named Anchor in IE and Firefox 11/20/2009 11:31 PM anna
great advice, thank you so much, this really helped me a lot.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: