Images: As A Link

 To use an image as a link, simply nest the <img> tag inside the <a> tag:

<a href="DocFile">
  <img src="ImageFile" alt="LinkText" style="width:42px;height:42px;border:0;">
</a>
HTML file: Displayed by browser:
<!DOCTYPE html>
  <html>
    <body>
<p>The image is a link. You can click on it.</p>
<a href="boo.html">
  <img src="images/smiley.gif" alt="surprise!" style="width:42px;height:42px;border:0;">
</a>
    </body>
  </html>

The image is a link. You can click on it.

surprise!

To prevent IE9 (and earlier) from displaying a border around the image, just add the "border:0;" attribute.

Back button Table of Contents Next button