Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

Always Use the <img /> alt Attribute

By Jennifer Kyrnin, About.com

One attribute is nearly always forgotten when creating and using images in Web pages:
alt

But this attribute has two very important uses in image tags:

  • accessibility
  • validity

Alt text makes your images viewable by people who use screen readers or who just browse with images off. Using alt text is required to make your pages accessible.

The XHTML has made the alt attribute of images required. So to write valid XHTML you must have the alt attribute and it must have text describing the image inside it.

<img src="URI" alt="alternative text" />

Jennifer Kyrnin
Guide since 1997

Jennifer Kyrnin
Web Design / HTML Guide

Explore Web Design / HTML

About.com Special Features

Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.