Hyperlinks in HTML

Hypertext Links

If you see a word that it underlined somwhere on a web page, it normally means that you can click on that word and be taken to another page. Because the word links you to another page, it is called a hyperlink. Links can take you to another section of the same site, or to another site entirely. For example, lots of people have links on their pages to those of their favourite pop group, actor, or football team.

Links are created using the <a> (anchor) tag. To create a link to Yahoo from your page, for example, you could use:

<a href="http://www.yahoo.co.uk/">Go to Yahoo</a>

This would give you a link that looked something like this:

Go to Yahoo

Picture Links

Links do not always have to be text. You could put the tag for an image between the <a> and </a> tags, for example, which give you a "graphical" button to click on. That is how the buttons down the left-hand side of this screen work.

Links to same page

Links do not always have to take you to another page. They can also be used to direct people to a particular part of the page they are already on. For example:

Click here to go to the top of the page

Frames and Windows

If you want to, you can make the linked page appear in a separate window, rather than over the top of the current page. This is done using the target setting. If you want the new page to appear in a new window, you can set the target to "_blank", e.g.:

<a href="links.html" target="_blank">Start a second copy of this page!</a>

Would give you this link:

Start a second copy of this page!

Combining Tags

Link text can be formatted by combining tags; just put the tags for the bold, or italic, or font size, or whatever you want to do between the <a> and </a> tags. In this way, you can make headings, pictures and table links if you want to.

Click here to see how to create a page...