C & G web

Using Hyperlinks

Anchors

The real point of the Web, of course, is that documents can be linked to each other, or to other types of files such as movies or sound clips, through the use of hyperlinks. These links allow authors to link documents together in intuitive ways, as opposed to traditional linear texts such as books, articles, or almost anything else printed.

In order to create a hyperlink, you'll need to know two things. The first is the URL (that is, the location) of the file to which you want the link to go. The second is knowledge of how links work, which is the subject of this chapter.

The Basic Anchor

The simplest possible anchor starts with <A> and ends with </A>. However, you will never ever use the <A> tag by itself, because it doesn't do anything. You'll need to enhance the <A> tag with attributes like...

    HREF

HREF stands for "Hypertext REFerence," which is another way of saying, "The location of the file I want to load." Most anchors are in the form <A HREF="URL">, where URL is the location of the resource to which you want the link to point. For example, the Runshaw College Web site is at "http://www.runshaw.ac.uk/" (that's the server's basic URL). A sentence which contained a link to that address would look something like:

Check out the <A HREF="http://www.runshaw.ac.uk/">Runshaw College Web site</A>

The words outside the angle brackets but between the open and close of the anchor ("Runshaw College Web site") would be displayed as a hyperlink. Selecting that link within a Web browser would cause the browser to link to and load the Runshaw College Web Site's main page. Here's what the above markup looks like in your browser:

Check out the Runshaw College Web site

The double-quote marks found around the value of HREF in an anchor are, under certain specific circumstances, optional. However, in most cases they are required. In addition, if you start the URL with a double-quote, you must close it with another. Just as tags need to be balanced, quote-marks do too.

Next page >>> - Using Anchors to link to a local Document.

Previous page...

Back to Top of Page

Computeach International Ltd

Christopher Ward London Limited

Christopher Ward London Limited