Reply to Re: #top anchor doesn't work in FF

Your name:

Reply:


Posted by Neredbojias on 10/31/07 12:36

Well bust mah britches and call me cheeky, on Wed, 31 Oct 2007 12:24:14
GMT Harlan Messinger scribed:

> 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>

Yes, and there's also something with the css/javascript display:none; on
the current "top" div. When I change things to:

<div id="top" style="display:block"><a name="tp" id="tp"></a></div>

and

<div id="gotop"><a href="#tp" title="zum seitenanfang">zum seitenanfang
</a></div>

....it works.

--
Neredbojias
Just a boogar in the proboscis of life.

[Back to original 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

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