Linking to other documents

The <A HREF=...> tag provides much more than just linking to other places on the same page. The HREF can be an arbitrary URL. Here's an example of HTML that can jump you off to other places...

<A HREF="http://www.nacs.uci.edu/">Jump to NACS' Home Page</A>

<A HREF="http://www.ics.uci.edu/">Jump to ICS's Home Page</A>

And here it is for real...

Jump to NACS' Home Page

Jump to ICS's Home Page


Pretty much any URL that you would give your web browser will work in an HREF. This includes URLs of gopher and ftp sites, and local files.


Absolute vs. Relative References

In a document that's in a given directory, you can make a link to another document in the same directory in two ways: by using the full URL to the next document (absolute) or simply giving the next document's filename (relative). This is all a function of your browser. It "knows" where you are and can interpret a relative reference by taking the URL that you're looking at and combining it with the filename that's given.

What's the difference? Imagine that you're developing a large number of documents and you're working on them in a particular directory. There are lots of links between the documents. If you should need to move the directory that all the documents are in, you'll have to change each and every HREF if you've used absolute references. If you use relative references, you will still be able to navigate between the pages if you can get to the first one.


[Next] [Previous] [Index]


HTML 2.0 Checked