XHTML Tutorial: Standards-Based Web Design

by Paul Bohman

Links

Links are fun. Links are what makes the web webby. It's the way that all the internet is connected and interconnected. When you click on links, you leave one spot in the internet and you go to another. Sometimes the links take you to a different spot on the same page, and sometimes they take you to a different page somewhere in the middle of China. It can happen.

Here's one way to create a link:

<a href="http://www.gmu.edu/">George Mason University</a>

When creating links, you have to know where the link destination is (the "href", which stands for "hypertext reference") and what text you'll have as the visible clickable link text. In our example, the words "George Mason University" will be clickable, like this:

George Mason University

Most anything on a web page can be made into a link, as long as it's either text or graphics. To turn our graphic into a link, we would wrap it inside of a link element, like this:

<a href="awebpage.htm">
 <img src="someimage.jpg" height="200" width="210" alt="Five parrots attack a helpless cute bunny" />
</a>

Notice that the <a> tags surround the image. That means that everything inside of the <a> tags will be a clickable link.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.