WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Null or empty ALT attribute?

for

From: Jared Smith
Date: Jun 10, 2005 4:28PM


Much of this alt=" " thing arose from early flawed screenreaders that
identified images that had alt="" but ignored images with alt=" ". Also,
many early (and some existing) tools did not allow the addition of true
empty alt text, so people just put a space in there so the alt attribute
showed up and they could be (supposedly) HTML compliant.

And to quote from the HTML specifications (though their example is a
rather poor one):

"Do not specify irrelevant alternate text when including images intended
to format a page, for instance, alt="red ball" would be inappropriate for
an image that adds a red ball for decorating a heading or paragraph. In
such cases, the alternate text should be the empty string (""). Authors
are in any case advised to avoid using images to format pages; style
sheets should be used instead."

In short, alt="" is correct. Null (or empty or whatever) alt text usually
indicates the use of images for decoration, spacing, and other
non-important elements. Such decoration/styling/positioning should be done
with styles instead, so this is why images that use alt="" should be avoided.

An obvious exception to this is when the alternative text for an image is
presented within the content of the page, such as in an image caption. In
this case, rather than repeating the description in the alt attribute, the
alt attribute for the image should be set to "".

Any system that does not allow null alt text (previous versions of
Frontpage and Dreamweaver come to mind) is flawed.

Jared Smith
WebAIM