WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Screen reader interpretations of images in text (not part of a link)

for

From: Jared Smith
Date: May 7, 2012 10:37AM


As has been noted, an image with no alt attribute and one with alt=""
are treated identically. For end users, this is a good thing. It would
be most unpleasant if all images that are missing alt attributes were
identified by a screen reader.

As far as WCAG is concerned, the alternative text success criteria has
an associated failure that requires an alt attribute. Because no alt
and alt="" for decorative images are treated exactly the same, it
seems odd to me that one is a WCAG failure and the other not.

alt=" " (space between the quotes) is never correct.

In HTML5, the alt attribute is currently optional. The idea is that
alt="" makes a declaration - the image is decorative or the
alternative text is presented elsewhere (such as in adjacent text or a
caption). These types of images should always be ignored (assuming
they are not the only thing in a link, in which case alt="" would not
be appropriate anyway).

An image with no alt attribute is ambiguous. It means, "The author did
not or could not provide alternative text." In this case, a screen
reader could identify the presence of the image and perhaps read the
image file name or do something else with it.

While there are many opinions on this approach, I generally think
optional alternative text in HTML5 could be better for accessibility.
As an example, if a user uploads many vacation photos to a web page
and decides not to give them alternative text, the page will always be
inaccessible and will always violate WCAG. If the alt attribute is
required, the author must either give them alt="" or make up some
bogus alt text (alt="photo") in order to be valid HTML. This
essentially declares the images as accessible when they are not. By
leaving off the alt attribute, the site would be valid HTML (though
still not WCAG compliant) and the user would at least be identified to
the presence of the images so they can do something with them if they
choose to. This all, of course, relies on screen readers treating
alt="" and no alt attribute differently - which they should eventually
do with HTML5.

Of note is that there are cases in HTML5, such as with
<figure>/<figcaption>, where no alt attribute is appropriate and
optimal for accessibility. This currently puts WCAG and HTML5 in
conflict with each other.

Jared Smith
WebAIM