html lesson 20

using images for links

We covered using images in html lesson 14 and html lesson 15, and we've covered using links in html lesson 18 and html lesson 19 so lets have a look at putting the two together in this short lesson.

We know about our anchor tags from the above mentioned lessons right? and we know about our img tags to display our images.

All we need to do to use an image as a clickable button is to replace the text lying between our anchor tags with the code used to display our image, like so:

Click the Ogre!! <br />
<a href="myfirstwebpage.html" target="_blank">
<img src="images/Nespers_Hammering_Ogre.gif" alt="click me">
</a>

The above code should result in something like this:

Click the Ogre!!
click me

When you're ready, click here to continue on to lesson 21 where we'll play around with lists.


Lesson added Tuesday 5th August 2008