[thelist] Anchor tags in FF not working

Lee kowalkowski lee.kowalkowski at googlemail.com
Fri Oct 27 04:39:45 CDT 2006


On 26/10/06, Julian Rickards <julian.rickards at gmail.com> wrote:
> No, it is a structural issue, Mark Groen caught the error first. It should
> be <p><a></a></p> (or better yet <p id="x"></p>).

You don't understand, let me explain - The structure was not causing
the LINKS to FAIL, they still WORKED, and they weren't going to the
wrong place.

Yes the structure was wrong, and fixing that solved the issue at a
high level, because it MOVED the targets to their intended places.
But the reason Firefox appeared to take you to the "first" target, is
because that's where ALL the targets were after the style sheet had
been applied.  As the targets had no content, you couldn't see that.

The content was actually in the P elements, and because the P elements
were floating, all the A elements were all in the same place.  Because
in Firefox (and most non-IE browsers), floating elements are not
contained by their container, unless their container is floated or
there is a subsequent clearing element.

Without the style sheet, Firefox worked fine.  If you change
<p><a></a></p> to <a></a><p></p> (still valid) you'll see what I mean,
all the states will appear together before all the location details.

I'm not saying that restructuring the document wasn't the right
solution, it was.  It just wasn't the right reason.  I was giving the
real reason why Firefox was exhibiting this behaviour, which wasn't
because Firefox had trouble parsing the incorrect document structure,
Firefox parsed the document gracefully, and was working as instructed.

-- 
LK



More information about the thelist mailing list