1. Computing

Discuss in my forum

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

©2013 About.com. All rights reserved.