Introduction     Sitemap

[HTML][JavaScript][Computer Stuff][Freeing the Mind]

Ken Ward's HTML Tutorial ...

Jumping to a given place in a page!

We have now learned about creating links using the <a href="MyPage.htm"> tag. We use the same <a>-tag to jump to particular places in the current or other documents.

At the bottom of this page there is a link to the top of the page.

This works by putting the code to name the part of the document you want to jump to;

<a name="top"></a>

at the top of the document after the <body> tag. In this case I haven't put any text between the tags. If you were jumping from a menu to parts of a long document, then you would give parts of the text names so your reader could jump to them.

The hypertext link is;

<a href="#top">Top</a>

Note the hash (#) sign which tells the browser it has to look for the name 'top'.

We do not need to specify the name of the current document because the browser takes this as the default, but it is probably good form to include the name of the file;

<a href="anchors.htm#top">Top</a>

If the file name were different from the current document, the hyperlink would go to that file, to the position where the NAME tag was. \

Clicking this link takes you to the top of the page.

Shall we look at images now?

[back to:  hypertext links]
[on to: images]

Most Recent Revision: 18-Oct-98.
Copyright © 1998

I am always pleased to hear from you.
Send your comments to