Personal Web Pages

  1. Home
  2. Computing & Technology
  3. Personal Web Pages

Linking To Yourself

By Linda Roeder, About.com

The same page HTML link is the HTML link that goes from one point on your Web page to another point on the same Web page. For example if you are on the bottom of a Web page and there is an HTML link that takes you back to the top that is an example of a same page link. Another use for this type of link is a table of contents.

The code for a same page link has two parts; the link and the hook. The link is, of course, that part that tells the browser where to go when the user clicks on it. The hook is what the link looks for and how it knows where on the page to go.

You need to create the hook first. You can't set up a link until you know what what address to put in the link so the browser knows where to go. You need to give your hook a name and you should put the link around text. In the following example I named the hook "top" and placed it around the title of the page to take the user back to the top of the page. The code for the hook looks like this:

<A NAME="top">Title Of The Page</A>

Now we can create the link. In the link we use the same name. This is what tells the browser where to go, it will now look for the hook called "top". This is what the code for the link looks like:

<A HREF="#top">Back To The Top</A>

Here I have created a same page link for you that will take you back to the top of the page using the above code:

Back To The Top

That's about it for now. Happy linking!!

Linda Roeder
Guide since 1998

Linda Roeder
Personal Web Pages Guide

Explore Personal Web Pages

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Personal Web Pages

  1. Home
  2. Computing & Technology
  3. Personal Web Pages
  4. Linking Ideas
  5. HTML Links - External HTML Links

©2009 About.com, a part of The New York Times Company.

All rights reserved.