Go to Lesson #8: Inserting Special CharactersGo to lesson #10: Special Linking TechniquesLinking to Other Documents

Now it's finally time to get to the meat of HTML; time to begin using the features that HTML was created to do. The most significant feature of the web is linking documents together. In fact, that's what makes the web work like a web. You can jump from document to document with no regard of where they are physically located.

For example, I could easily create a document which references (links to) other documents in China, Russia, The Library Of Congress and the island of Tonga. If I skillfully pieced these pages together, you might never even know these were different documents.

The tag used to link documents together is called ANCHOR, and it's represented in HTML as simply A. The ANCHOR tag has lots of possible arguments and many different functions, which can make it extremely confusing.

To create a link to another document you first need to start the ANCHOR and indicate where to proceed if the link is clicked. You then include text, a picture, a multimedia element or some other element to inform the visitor what the link is all about. Finally, you close the tag.

An example of a simple link is shown below.

<A HREF="http://www.internet-tips.net">Tips</A>

The A begins the tag and the HREF attribute tells the browser which file to display if the link is clicked. The word "Tips" is the text that is displayed in the browser (by default underlined in blue) and the </A> ends the tag.

The way this looks is:

Tips

There are lots of other things that you can do with ANCHOR. To begin with, you can display an image instead of text for the link.

<a href="http://www.internet-tips.net"><img src="images/Richard.gif"></a>

Which is displayed as shown below. Click on the picture and you call the page into the browser.

By default, clicking on the link calls the page into the browser window, replacing whatever is there. Sometimes, however, you may want to create a new window. This is done by including the TARGET attribute.

<a HREF="http://www.internet-tips.net" target="_blank">Tips</a>

Clicking on this link will create a new window containing the specified page.

Tips

You can link to any type of object, including sound files, videos, images and even downloadable programs. Some examples are shown below.

Link to a downloadable zip file containing a picture of a bee.

<A HREF="http://wallpapers.internet-tips.net/bee640X480.zip">
Bee picture</A>

Link to a WAV (sound) file. Clicking on the link plays the sound.

<a href="http://www.mailmsg.com/sounds/spam-song.wav">Sounds/spam-song.wav</a>