Creating Links

Links allow you to skip from one page to another, watch movies, or listen to music.  A link has three parts:

  1. destination -- used to specify what will happen when the visitor clicks the link.
  2. label -- part the visitor sees and clicks on the reach the destination.
  3. target -- determines where the destination will be displayed.

  4. (often left up to the browser, but can be a particular window or frame, or a new window or frame.


What we'll be learning:

  1. How to create a link to another Web page using HTTP
  2. How to create an Anchor
  3. How to link to email


Let's Get Started!


How to create a link to another Web page using HTTP:


Once you learn this format, you can make as many links as you want to any other page you want.
To begin:
Type <A HREF="URL.html">Type here the name of the page you are linking</A>

Here are two examples:

A FUNCTIONAL HOUSING MARKET

The Titles directory does not have an index.html file.  The link below will show you what will happen if the URL ends at a directory.

A List of File Names in the "Titles" Directory

hold the cursor over the link above and note the URL in the lower bar on this screen.

This is what will appear on the page if you use the command above...Note that this page "lives" in the same directory as the file you are reading. (the URL starts out exactly the same.  The only difference in location is the file name.)
HELLO!
Back to Top

Creating Anchors:

Normally, a click on a link brings the user to the topof the appropriate Web page. If you want to have the user jump to a specific section of the Web page, you have to create an anchor.

To create an anchor:

  1. Place the cursor in the part of the Web page that you wish the user to jump to.
  2. Now Type <A NAME="anchor name">anchor name is the text you will use internally to identify that section of the webpage words you wish to be referenced
  3. Add the words or images that you wish to be referenced.
  4. Type </A> to complete the definition of the anchor.
Once you have created an anchor you can define a link so that a user's clikc will bring them directly to the section of the document that contains the anchor, not just the top of that document.

Linking to a specific anchor

  1. Type <A HREF="#
  2. Type anchor name, where anchor name is the NAME of the destination section (step 2 above).
  3. Type ">
  4. Type the label text, that is, the text that will be underlined or highlighted in blue, and that when clicked upon will take the user to the section referenced in step 2.
  5. Type </A>to complete the definition of the link.
"Note there are "anchors" at the top of this page that take you to each of the three sections"
Back to Top

How to link to email:

Allowing people to write to you from your page is quite simple.

Use the following formula:
<A HREF="mailto:your login@cs.rice.edu">Send me comments</A>

What this does is place the blue wording on the screen so people can click on it to send you a piece of email.  It is always a good idea to show your e-mail address also.  Some people do not have the ability to send mail from their browser.  Avoid the tempatation to have just an image of a letter, or just text to send comments with the mailto link pointing to it.

Send me comments:  sboone@cs.rice.edu
Back to Top
ceee_line.gif (66 bytes)

Use HTML 4 For the World Wide Web   by Elizabeth Castro as a reference for the lesson

Last edited June 17, 2001
Back to Tuesday's Lesson
URL:  http://teachertech.rice.edu/Materials/GT2000/Mac/day02/link.html

ceee_line.gif (66 bytes)
These pages were developed through GirlTECH , a teacher-training program sponsored by the Center for Excellence in Education (CEEE) and made possible by support from the National Science Foundation through EOT-PACI.
Copyright © Susan Boone, June 2001.