Creating Links

To create a link in HTML, you need two things:

The Link Tag

To create a link in HTML you use the tags <A> and </A>. The <A> is also known as an anchor tag, as it can also be used to create anchors for links. The "A" tag has several attributes. An example of a link looks like this:

<A HREF="../lists/Lists.HTML">Go to Lists Page</A>

Go to Lists Page

The HREF stands for HypertextReFerence which specifies the URL that the link points to. The text "Go To Lists Page" is the text that appears on the screen that the view can select to go to the link location.

Linking local pages using Relative and Absolute Pathnames.

Relitive pathnames draw a path from the current directory to the target file. Here are 4 examples of relitive pathnames:

HREF="file.html"
Path to a file in the same directory.
HREF="Subdirectory/file.html
Path to a file in a subdirectory of the directory that you are presently in.
HREF="../file.html"
file.html is located in the directory one level up from the current directory.
HREF="../../here/file.html
file.html is located two directories up and back down into a subdirectory named "here".

Absolute pathnames refer to files by their exact location starting with a / then the name of the disk where they reside. Here are some examples of absolute pathnames:

Links to Other Documents on the Web

A link to a page on the web looks just like a link to a file on your own machine, except instead of a pathname to a file on your machine you use a URL to the page on the web. Here is an example:

<A HREF="http://www.cern.ch/">Cern Home Page</A>

Cern Home Page

Linking to a specific place within a file

(Anchors)

To do this you must create an Anchor at the location where you want to jump to. You create the anchor in nearly the same way that you create the link. Here is the code to make an anchor at the above title:

<A>NAME="Anchor1">Here</A>

Here is how you make the link to jump to this section. Notice that the HREF attribute is different than the previous links HREF attribute. There is no path to a file name, instead there is a # mark that denotes the current file then the name of the anchor. At the end of the link there is the familiar hypertext to mark the link in the browser.

<A HREF=#Anchor1>Go to above title</A>

Go to above title

To jump to a specific location in another file, you need to supply a path to that file followed by the name of the anchor. Here is an example of the code to do this:

<A HREF="../lists/Lists.HTML#Glossary Lists">Go to Lists, Glossary Lists</A>

Go to Lists, Glossary Lists