Anchors are simply a way to link to a specific section of a web page. By default when a browser follows a link it takes the viewer to the top of the page. With anchors you can specify exactly where on a page you would like your visitors to end up after clicking on a link.
Anchors are particularly useful to use in the table of contents of large web pages. They are also useful for taking visitors to particular sections of documents from another web page.
Below is a working example of anchors on a web page, followed by the code you will need to use anchors.
The best part about anchors is that they are reasonably simple to use. Basically it is just naming each individual part of your website and linking to that name. [Back to contents]
You have probably seen anchors used before within large terms and conditions pages when signing up for some services on the internet. This is just one of the many places anchors are used around the web.
[Back to contents]
Now that you have read this far, you will hopefully have an idea of how anchors are used on web pages. The next step is implementing them on your web site! [Back to contents]
Now for the code: <H3><A NAME="contents">Table of Contents</A></H3> <A HREF="#section1">Link to section one</A><BR> <H4><A NAME="section1">Section One</A></H4> <H4><A NAME="section2">Section Two</A></H4> <H4><A NAME="section3">Section Three</A></H4> |
To link to a document within another website:
<A HREF="http://www.whatever.com/pagename.html#xxxx>Link Text</A> (where xxxx is the unique name of the anchor you wish to link to)