You are here: Re: #top anchor doesn't work in FF « HTML « IT news, forums, messages
Re: #top anchor doesn't work in FF

Posted by Harlan Messinger on 10/31/07 12:24

Bernhard Sturm wrote:
>
> Hi Group,
> We are currently testing a site: http://wwwt.ichschweiz.admin.ch/ which
> has a 'top of page' navigation at the bottom of each page (pointing to
> an anchor at the top of the html-structure).
> The problem is, that this 'top of page'-navigation doesn't seem to work
> with Firefox (2.0.0.9 / Windows XP). IE has no problem with the link. I
> am sure I made something wrong, but I can't figure out where I missed
> the right turn. Could some of you have a look at it, and tell me where I
> missed it?

You have a div with id="top" and an anchor with name="top". This is
incorrect HTML:

http://www.w3.org/TR/html4/struct/links.html#anchors-with-id

Firefox sees two different elements that could be the destination for
the link and therefore can't react to it. (The fact that they are nested
or adjacent is irrelevant.) IE probably handles the flawed code by
ignoring the A tag because by that point it has already registered the
DIV tag as the "top" element.

The solution is to take the ID off the DIV and stick it in the anchor:

<div><a id="top" name="top"></a></div>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация