The '#' is used in the href attribute, to indicate the fragment
identifier. You have to exclude it in the name (or ID in XHTML)
attribute. So
<a href="#someName">go to someName</a>
scrolls to
<a name="someName">This is someName</a>
Ignoring # in names is wrong AFAIK and IE's behaviour is just
stupid_author_friendly. That's the kind of stuff that ruins the web
through incompatibility; people then say "but it works in IE!".
hth
Manos
Brent Schartung wrote:
> I've noticed that there are a few web pages out there that use
> <a name="#thelink">
> instead of
> <a name="thelink">
>
> Would it be possible for the HTML parser to ignore the leading # in anchor
> names? Has anyone looked into this before?
>
> The following HTML should give you a good idea of what I'm talking
> about--Try clicking all four links at the top. Note that in IE all four
> links are handled as if no leading # is present. (Forgive me if there are
> conventions for posting HTML that I don't know about!)
>
> - Brent
>
>
> <html>
> <head>
> <style type="text/css">
> div { height:400px }
> </style>
> </head>
> <body>
> <a href="#link1">Link #1</a> <br />
> <a href="#link2">Link #2</a> <br />
> <a href="#link3">Link #3</a> <br />
> <a href="#link4">Link #4</a> <br />
>
> <div> <a name="link1" />Link #1 Destination </div>
> <div> <a name="#link2" />Link #2 Destination </div>
> <div> <a name="link3" />Link #3 Destination </div>
> <div> <a name="#link4" />Link #4 Destination </div>
>
> </body>
> </html>
>
>
>