The chief power of HTML comes from its ability to link from one document to another.
We will learn about how to tell the browser what to do when somebody clicks on them.
A link is specified by the generalized format:
<A HREF="URL">Link Text</A>
In links, the "A" represents the word "Anchor."
The "A" tag has the attribute, "HREF", which stands for Hypertext REFerence.
The most important part of the link is the name of where you want to jump to
when the user clicks on the link. You specify where to go using a URL.
A URL simply stands for "Uniform Resource Locator." This is just jargon
for the address of the page you want that you want to link to.
A URL to a file on another computer looks like this: http://www.lesley.edu/
The URL is also put into quotes. So, all links begin with code that looks like this:
<A HREF="http://www.lesley.edu/">link to lesley home page</A>
This would look like this in a browser:
Any text contained between the < and > brackets will be visible to the reader and highlighted
by colored underlining. When the text is clicked, the reader will be taken
to the location specified in the URL.
Here is an example of the code for linking to the Tech Ed program site.
(Don't panic if you don't understand it--just try it now. We will review again later!)
<A HREF="http://www.lesley.edu/soe/tech_in_ed/techined.html">Lesley Tech in Ed Web Site</A>
Put this code in your document and save it, then view the document in your browser.
It should look like this: Lesley Tech in Ed Web Site
When you click on it, you should see the specified page on the Lesley Web Site.
You can also link from the current document to a file located in the same directory.
To link to another HTML document in the same directory as the current file,
all you need is the file name in the URL. So, if the file "here.htm"
is in the same folder, you would create the link with this code:
Go <A HREF="here.html">here</A>!
It would look like this in a browser: Go here!
When you click on "here" the browser should jump to the file named "here.htm"
If the file is on a different machine than the current file,
the link would need to contain the file's full address in the URL.
It would look like this:
Go <A HREF="http://www.server.edu/here.html">here</A> !
Link Recipe
First, find a URL on the Internet on another server that you would like to link to from your document and write down the full address that appears in your browser. Then, open up your document and add a link to the full URL. In order to make a link:
See Basic Links Castro pp. 107-109 (alt. pp. 117-119)