HTML Code Tutorial

Tutor Ebook Download

Anchor Tag - Intradocument Linking

Intradocument Linking

Intradocument linking is linking to a location on the same page.

To link to a location on the same page, you need two anchor tags.
Hyperlink Reference <a href=></a>
Name Tag <a name=></a>

This configuration is used for the common Back to Top link on HTML pages.

The code is:

<a href="#destination_name">Destination</a>
The href destination is preceded by the pound sign.

The matching Name Tag: Provides a location to jump to.

<a name="destination_name"></a>

The <a name=> tag is placed at the desired location you wish to jump to. The name must match the hyperlink tag exactly, excluding the pound sign.

Designate Location on Another Page

The name tag can also be used to go to a designated location on another page. The name tag would be placed on the page at the desired location.

To link to that page and location the code would be:

<a href="samesite.htm#destination_name">Another Page</a>


Avoiding Problems

1. Some free webhosts will display your pages within a default frameset. On these sites avoid using the word Top as a name for a destination for the Back to Top link.

2. Most browsers will ignore name tags that are placed too close to the bottom of the page.

Take a Quiz on the 3 Anchor Tag Lessons





CGI Online
How to Create a Website -Tutorial
Main Website


This Free HTML Tutorial
is provided by Net Success 2000 Plus Inc.
PO Box 1508
Somerset, KY 42502
Last Modified: September 3, 2007

HTML Codes Tutor Ebook