In another beginning HTML article, I wrote about how to add links in HTML documents.
But often you want to link to the same document, and simply skip down to the specific section referenced. Eventually, it may be possible to link to exact pixel locations in documents, but for now, you need to use the anchor tag (A) to create both the link and the location to be linked to.
First, you should create the document and decide where you want your internal links to go. You label these using the anchor tag (a) with the name and id attributes. The name and id attributes should be identical. e.g.
<a name="anchor1" id="anchor1">Anchor text</a>
Then second, you create the link to the site using the anchor tag (a) and the href attribute. You indicate the named area with a pound-sign (#). e.g.
<a href="site.html#anchor1">Anchor link</a>
The trick to this is to make sure that you have put the <a name> around text or an image. For example:
<a name="here">Here</a>
Many times you will see people who use these links without surrounding anything (e.g. <a name="1" id="1"></a>), but this is not as reliable an anchor as when you surround a word or image. Many browsers like to have some element to position at the top of the screen, and when you enclose nothing, you run the risk that the browser will be confused.

