The Anchor Tag: Creating hypertext links
The Anchor Tag href Attribute:
- Turns anchored text into hypertext.
- Turns anchored images into hyperlinks or buttons.
- Takes the form:
href="URL"
within the a tag.
The Anchor Tag name Attribute:
- Allows anchored text to become the target of some other href.
- Takes the form:
name="somename"
within the a tag.
- Useful when you want a hyperlink to jump to some point
within a document.
Internal Hypertexting Techniques
Using the "#" or pound sign allows you to set up a hyper link within the current HTML document,
or even within a remote HTML document. Click on the HTML Internal hyper link Anchor
to go to the End of this Document
and then Return here from the "End"
URL stands for "Uniform Resource Locator."
-
A URL can be a filename, like "index.htm" The anchor
<a href="index.htm">here's the link</a>
which is identical to:
<a href="./index.htm">here's the link</a>
points to the file "index.htm"
in the current directory (where this the 'calling' file resides).
- A URL can be a path
/ refers to the root, or top, directory of the web site.
The anchor
<a href="/index.htm">root directory file</a>
would point to a file called "index.htm" in the top directory.
./
refers to the current directory, and
../ refers to the directory above the current one.
The anchor
<a href="
../../index.htm">another link</a>
points to a file
two directories up.
-
A URL can be a full HTTP address, of the sort often given in
articles and advertisements.
The format for these is:
http://host.domain.org/path/to/something.
For instance, the anchor
<a href="http://www.pratt.edu/bookstore/bookvid.htm">
books</a>
points to the file "bookvid.htm" in the "bookstore"
directory on the server www.pratt.edu
-
Finally, a URL can also be the full address of an ftp
("file transfer protocol"), or telnet resource;
the only difference is that ftp://
, or telnet://
would begin the URL instead of http://
Hyperlinks:
Table of Contents
Questions? E-mail your Instructor -
Dr. Charles Rubenstein
Tutorial Copyright (c) 1996-2006
C.P.Rubenstein