Skip Navigation

 

Library, Information and Technology Services

Web Services

Graphics

ALT Attribute

Graphics on your web pages should always include the ALT attribute. This sets the text that will be displayed when graphics are turned off on a browser or a browser does not support graphics.

If the ALT attribute is not included in the IMG tag, the image will display fine in graphical browsers but those in the text world will get only [IMAGE] or some other useless identifier (if any).

It is good practice to include the ALT tag empty if the graphic isn't important to the content. Ex: For a page divider, the IMG tag would look like:

<img src="line.gif" alt="" height="3" width="480" / >

Graphic Buttons

The ALT attribute is even more important when you turn a graphic into a link. Imagine opening a page that said [IMAGE] five times. A user could tell they were links but would have no idea where they went. It only takes a few moments of the page author's time to make the page fully functional.

Next Tip