1. Computing

Discuss in my forum

How to Link an Image

By

Linking images is just as easy as linking text.

Difficulty: Easy
Time Required: 2 minutes

Here's How:

  1. Place your image in the HTML document:
    <img src="image.gif" alt="alt text" />
  2. In front of the image tag, add your starting anchor link:
    <a href="URL"><img src="image.gif" alt="alt text" />
  3. Add a style to remove the border from the image:
    <a href="URL"><img src="image.gif" alt="alt text" style="border:none;" />
  4. Then close the anchor tag right after the end of the image tag:
    <a href="URL"><img src="image.gif" alt="alt text" style="border:none;" /></a>

Tips:

  1. Don't put any spaces between the anchor tag and the image tag. If you do, some browsers will add little ticks beside the image, which look odd.
  2. If you leave off the style, the image will have a border around it in the default link color.

©2014 About.com. All rights reserved.