WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Al text


From: Jukka K. Korpela
Date: Feb 23, 2010 10:15AM

Geof Collis wrote:

> Just read on another list that using an " " in alt text , for
> example alt=" " was acceptable. This goes against anything I've

We must not judge any alt text as unacceptable without knowing the context
and the meaning and role of the image. Even if we cannot imagine acceptable
use, there might be some.

Consider the following fragment of markup:

<img alt="alpha" src="alpha.gif"><img alt="&nbsp;" src="spacer.gif"><img
alt="beta" src="beta.gif">

When images are rendered, this might display as an alpha symbol followed by
spacing of specific width and a beta symbol. A speech browser can be
expected to read it as "alpha beta", as two words. Any speech browser that
cannot treat a no-break space the same way as a space is in need of repair.

The no-break space is effectively a clone of the normal space character,
with additional properties related to line breaking. And this is why here
alt="&nbsp;" might better than alt=" " here, since graphic browser, when not
displaying the images for some reason or another, can be expected to honor
the non-breaking nature of the no-break space. And we can well imagine
reasons why an author would like to keep the words "alpha" and "beta" on the
same line in visual rendering.

I'm not saying that such authoring style is particularly exemplary. But it
isn't absurd or horribly wrong, and assuming that an author has decided to
use small images of symbols to present some expression, like a formula or a
logo, and to use an image for spacing, the question arises what the alt text
should be. What else should it be than the no-break space, given the

(Of course one can use the no-break space as a character. There is no magic
in using the entity reference &nbsp; instead, except that it is easily
distinguishable from a space in HTML source.)

Even though alt="", alt=" ", and alt="&nbsp;" have all been used to fool
accessibility checkers or to comply with some formal rules or due to mere
misunderstanding, they are (especially the first one, with empty alt text)
have proper uses as well.

Yucca, http://www.cs.tut.fi/~jkorpela/