Elementary HTML - Part 3

#13 Links within a page

You have seen how to link to other web pages, whether they are ones you created or have found elsewhere on the Internet. You can also make connections within a single document, or to specific locations in other documents.

If your file is long, it might be useful to be able to skip to a different section of the same page. Or to a marked section of another page. This can be accomplished in two steps by using named anchors, which are hidden reference marks.

  1. Embed a named anchor in the target location.
  2. Place a link to that target from some other location.

Embedding Named Anchors

To show how this works, on your course page we will place a table of contents right under the Welcome greeting. A couple of these will be linked with anchors placed elsewhere. First, we will embed named anchors for each of the main heading sections on your course page. Then we will create the table of contents.

  1. Open your index.html file in the text editor
  2. Find the heading <h2>Introduction</h2>. Enclose it in anchor tags so that it looks like:

    Don't forget the closing </a> tag. You have now marked the line that contains the header Introduction with a hidden reference marker, the named anchor intro. It won't look any different in the browser.

    Let's do one more.

  3. Find the heading <h2>Visual protrayal</h2>. Change it to

Adding Links to a Named Anchor in the Same Document

Now we will set up the table of contents that will appear near the top of the screen. We will use an unordered list to create this list (see Module #5 for more on lists).

  1. In index.html below the welcome message and above the line break <hr>, add the following:
  2. Save and reload into in your web browser. You should see the list near the top.
  3. At this point we have only entered the text of the index entries. Now we will add the HTML to connect the top listing with other sections of the document. We indicate a named anchor by preceding the reference marker name with a "#" symbol:
  4. In the index.html text file, go to the first list item near the top. Change it from

    to

  5. Fill in the other link to a named anchors that we set up. Change

    to

  6. Save and Reload in your web browser. When you click on an underlined (hot) item in your list, the browser should display the associated section at the top of your screen. The BACK button returns you to the starting link location.

FONT COMMANDS

TABLES

MISCELLANEOUS



RESOURCES

Once you get on to HTML coding, a handy tag reference is

For more information on graphic design, check out the following Internet sites.

###