Creating Links


Introduction | Text | Images | Links | Colors | Tables | Resources

Links

Links are embedded into an HTML document using the anchor tag.

There are five basic ways to use the anchor tag (see examples in the table below):

Anchor tag <A>
End tag </A>
Attributes HREF="URL_of_destination"
NAME="anchorname"
TARGET="_blank" to open link in a new window
Example:
absolute link
<A HREF="http://www.tufts.edu">Link to Tufts</A>
Example:
relative link
<A HREF="links.html">Link to a file named link.html in local directory</A>
Example:
sending an email
<A HREF="mailto:username@tufts.edu">Send an email to username@tufts.edu</A>
Example:
creating and using an anchor to jump to specific location on a page
<A NAME="here"></A>
<A HREF="#here>Go to the anchor named "here" in current document</A>

Everything placed between the <A HREF=" "> and </A> constitutes the link; you can embed images and text as part of the link.

Exercise 4

  1. Add a link of your choice to your index.html page.
  2. Modify your HTML code so that if the user clicked on your name, it links to your email.
  3. Save index.html.

Introduction | Text | Images | Links | Colors | Tables | Resources
© June 2001 | Thermal Analysis of Materials Processing Laboratory
Tufts University Medford, MA 02155 | Contact: Haruna Tada