The address for this web page is:   http://fishcaro.crosswinds.net/day_13_more_on_images_nse.htm
On to the next lesson!
Back to the COURSE SYLLABUS

13. MORE ON IMAGES

INDEX CARD #13:

USING A GRAPHIC AS A LINK (13a)

How can I use a graphic as a link? Just place the anchor tags around the image tag (and text, too, if desired), like this:
<A HREF="URL_link"> <IMG SRC="URL_image"> Some text... </A>
Here's an example which uses an "animated GIF" (future lesson!) as the image source:
dancing Hobbs There are some fun icons here!

How can I tell when a graphic is being used as a link? When a graphic is used as a link, the default is usually a 1-pixel-wide border around the image (see the example above). You can change the width of the border by using the BORDER attribute. You specify the width of the border, in number of pixels:
<A HREF="URL_link"> <IMG SRC="URL_image" BORDER=2> </A>
If you set BORDER=0, then the border will disappear. Remember, however, that if you remove the border, then you're removing the visual clue that the graphic is a link, so your reader may not know to click on the image!

ALTERNATIVE TEXT FOR IMAGES (13b)

What happens to my image if a person has graphics turned off, or the graphics file can't be found? A generic icon is put in its place, which gives no hint of what was supposed to be there. A better alternative is to have some descriptive text appear whenever your graphic is unavailable (for whatever reason), which brings us to...

How do I provide alternative text for a graphic? Use the ALT attribute, as follows:

<IMG SRC="URL_graphic" ALT="alternative text">
Take the time to provide alternative text for images, and you'll be making your web page accessible to a much wider audience. The HTML 4.0 specification has declared ALT to be a required attribute for the <IMG> tag (but browsers aren't currently enforcing it).

Printable version of Index Card 13a

Printable version of Index Card 13b

WORKSHEET #13:

ASSIGNMENT #13:

On to the next lesson!
Back to the COURSE SYLLABUS
© 2000 Carol J.V. Fisher    All Rights Reserved