Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage

Linking to a specific location on a page

Tech Computer Center logo

An anchor is used to name a particular spot within a document. To define an anchor, use this sequence:

    <a name="anchor-name">text</a>
This defines a named anchor at the location of the text, so links elsewhere can point to this spot.

To make a link to an anchor:

    <a href="#anchor-name">text</a>
This displays the given text with a link to anchor-name.


Suppose, for example, you want to link from the top of your page to an occurrence of the phrase ``water conservation.'' First you create an anchor where you want to jump to:

    <a name="watercons">water conservation</a>

Then, at the top of your page, you put:

    See the <a href="#watercons">section on water conservation</a>

Linking to an anchor on a different page

To set up a link that jumps to specific location in a different document:

    <a href="URL#anchor-name">text</a>
where URL is the URL of the page to which you want to link, and anchor-name is an anchor defined on that page.
Next: Adding titles and headings in HTML
See also: The Web's source language: basic HTML
Previous: Building links between pages in HTML
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman,
Last updated: 2000/02/15 22:08:41 UT
QR two-dimensional bar code