Learn how to Create a Link Within a Page

Why Link Within a Page?

Once you've discovered how to create a link to a web page, you may want to become more precise with your linking. Linking to a precise point within a page is especially helpful if you're dealing with lots of complex data.

Here are a few examples of ways to use links within a page.

  • Link to an exact definition within a glossary, dictionary, or FAQ.
  • Link to the line of data you're describing in a report.
  • Give a list of topics at the top of a long web page, and link the topics to the information.
You'll want to understand how to create links to web pages before you start creating links within a page.

The HTML for Creating a Link Within a Page

Linking within a page requires two different HTML tags. First, you'll want to define what the link will link to. This uses the A NAME tag.

Let's say you have a definition that you want to link to:

FAQ - a list of Frequently Asked Questions.

To be able to link to this, create a unique name (we'll get real clever here and use FAQ):

<A NAME="FAQ">FAQ -</A>; a list of Frequently Asked Questions.

You're halfway to creating your link! If you're linking within the same page, you'll want to create an A HREF tag like this:

Check out our <A HREF="#FAQ">FAQ -</A>

If you're linking to another page you'll want to include the path to the HTML page as well:

Check out our <A HREF="../intro/glossary.htm#FAQ">FAQ -</A>

just a griffin

Double bonus points if you've figured out why you never want to use the number symbol (#) in a filename. It confuses the browser if you've named your gif, for instance, Pic#1.gif. The browser recognizes the # sign as part of a link.

Create Your Own Web Adventure with the Web Diner!

All content copyright of Web Diner Inc., 2000. Do not redistribute or repost this content.
Tutorials | Home | Glossary