WWW FAQs: How do I link to a specific part of a page?

2004-02-16: place a "named anchor" at the point you wish to link to. You can then easily link back to that anchor.

To create a named anchor, just use HTML like this:

<a name="anynameyoulike"></a>

Then, you can jump back to that point in the page with a link like this one:

<a href="#anynameyoulike">Jump to Named Anchor</a>

To jump to a specific anchor in a different page, just use the #anchorname syntax at the end of the link:

<a href="http://www.example.com/examplepage.html#anynameyoulike"> Jump to Named Anchor in Another Page</a>

That's all there is to it.

Share |

Legal Note: yes, you may use sample HTML, Javascript, PHP and other code presented above in your own projects. You may not reproduce large portions of the text of the article without our express permission.

Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!


Follow us on Twitter | Contact Us

Copyright 1994-2014 Boutell.Com, Inc. All Rights Reserved.