HTML Links

One of the integral aspects of the internet is that its pages can be linked to one another in a huge web (hence the term World Wide Web). For example you might want to link your home page to another page in your site, or several other pages, or even to other people's sites. HTML gives us some useful tools for creating these links and, as with most things HTML, they are very simple to use and understand.

There are three main types of links, which we will look at in more detail over the next few pages, but they all work in exactly the same way.

The HTML tag for creating a link is the <a> tag, which stands for anchor. To use a link you also need to specify the web page that the link is pointing to. You can do this by putting the web page address in quote marks after the phrase "href=". After the opening tag you put the link text, and finally you close the whole thing with the closing tag. Putting it all together we get something like this:

<a href="target page">Click here</a>

This format is the same for all links and although it isn't quite as straightforward to remember as some other HTML tags, you'll soon be using it like it's second nature.

There is another useful HTML attribute that we can assign to links, and that's the "title" attribute, which we can use to give a bit more information about the link. When the user hovers their mouse pointer over the link for a couple of seconds, the title text will be displayed. We use title like this:

<a href="target page" title="more information here">Click here</a>

Let's move on and look at the three types of link; you'll see that they are all very similar but subtly different.