Curby wrote:
What is the recommended way for linking back to the top of the page? I
can't link to the id of my H1 because of my CSS. The name attribute of
the A tag is deprecated/removed[1].
...
[1] http://www.w3.org/TR/xhtml11/changes.html#a_changes

It's only deprecated in XHTML 1.1, which you almost certainly shouldn't be using anyway since it's really not supposed to be served as text/html. If you really want to jump on the XHTML bandwagon, stick with XHTML 1.0.

And while some people might say "use the scrollbar or press Home"

That's always possible and why I never bother with back-to-top links.

1) Giving my BODY id="top" and linking to that seems to work but might
not be widely supported.

I'm not aware of any browser that doesn't support it, though it's possible some older browsers may choke on it. If you use a container element around the whole content, you could use that instead:

<body>
  <div id="container">
    ... content ...
    <a href="#container">top</a>
  </div>
</body>

--
Lachlan Hunt
http://lachy.id.au/

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to