The Web Just This Site

NM Web Tutorials

Basics: Image Link

XHTML

What The Code Does

<a href="http://www.youtube.com/">
<img src=
"images/youtube.jpg" alt="Youtube Logo" width="172" height="128" border="0" /></a>

Youtube Logo

It may look a little bit complicated, but making a picture link is almost exactly the same as making a text link, but there is a couple of extra steps.

Instead of typing in the “Click here” text (or whatever it was you wanted it to say), type in the code you would use for displaying a picture. However you should notice that I’ve added something after the width and height part. For some reason when you make an image link, the XHTML assumes that you want a border around your picture until you state otherwise. After the width and height section, type in border="0", the number once again is in the unit of pixels. So if you want a border around your image, by all means do so. Once we progress in the tutorials, you’ll see why you probably won’t want a border.