HTML Image Links

As well as static pictures, we can also use images as HTML links. These are identical to text HTML links, only this time the user clicks on an image rather than text to be taken to the destination page. In order to create an image link we have to place the image inside the link tag, like this:

<a href="target.htm"><img src="filename.jpg" /></a>

We can still apply all of our usual attributes to both the image and the link tags.

When we use an image to create a link, the picture will be displayed with a border round the outside to show that it is a link. This can be removed using CSS, but it is always a good idea to have something to show the user that the images are in fact clickable links rather than just static images.

A popular use of image links is for creating stylish links that cannot be made using text alone.