To Top Of Page

Whats another way I can jump my page from the bottom of the page with a “Back to Top” link without adding an empty #top div right after the body? Is there any way to do this without adding an extra div? I can probably add an id to the body but would want to avoid that if possible

You need to put an id on some element at the top of the page (or use an existing id on an element up there). It doesn’t matter if it’s the body, the h1 or an existing div.

Out of curiosity, is there a particular reason why you don’t want to put an id=“top” on the body element?

How about just:

<a href="#">Back to Top</a>

thx for the replies! I tried the <a href=“#”> and it does work to get to the top, but I’m using a local scroll javascript so i went with giving the body an ID and its workin perfectly

thanks!

Related: http://www.sitepoint.com/forums/accessibility-usability-191/back-top-link-href-value-761998.html

I’ve found that gives problems with certain CMSs.