slscart logo

What is the Alt Attribute?

The alt attribute, or alternative attribute, was designed to provide a text description of an image if the image cannot be rendered. In fact it is part of the HTML coding standard. Its uses are many:

Note that the alt text is a replacement for the image, the title gives a brief description (caption) of the image, and the longdesc file gives a long description of the image. The alt text is not supposed to be a description of the image, it is supposed to be an alternative representation of the meaning of the image.

The search engines gather information about the image through several sources:

ALT attributes can use to add some flavor to navigation images such as "About Us" can have alt text like "learn more about xyz company".

Check your web page with images turned off. See if the descriptions and navigation makes sense.

If you have a better business bureau image you can spruce up the alt attribute like:

alt="We are a Better Business Bureau accredited business. Click here to verify our BBB rating."

Alt Attribute Coding

Alt attribute coding differs between HTML and XHTML

<img src="img.jpg" width="90" height="80" alt="open casement window">

Put no text in the alt attribute for images that have no meaning such as spacers, decorative images, or any page formatting.

<img src="spacer.gif" width="1" height="5" alt="">

Alt Attribute Text

Tips on Writing an alt Attribute

Negative Uses of the Alt Attribute

The alt attribute can be abused and in some cases have a detrimental effect on SEO efforts.