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

Always Use the <img /> alt Attribute

By , About.com Guide

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" />

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.