WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: alt="" vs alt=" "

for

From: Jukka Korpela
Date: Apr 9, 2002 1:13AM


Jon Gunderson wrote:

> If users were provided with more control over browser
> rendering, a browser could render both the images and
> the ALT text at the same time.

Even some current browsers can be configured to behave that way. The CSS2
specification mentions this is an example:
The next rule inserts the text of the HTML "alt" attribute before the
image. If the image is not displayed, the reader will still see
the "alt" text.
IMG:before { content: attr(alt) }
http://www.w3.org/TR/REC-CSS2/generate.html#content

Testing with a slightly more complicated style sheet, intended to make the
alt text appear within [Alt: ...] on a line of its own under the image,
img:before { display:block; content: "A[Alt: " attr(alt) "]A"; }
I noted that Netscape 6.1 (Win) supports this except for the line breaks,
and Opera 6 seems to implement it just as specified. (By accident, actually:
it seems to put the text on a separate line even if I omit the A's.)

So some users might actually use their own user style sheets that make their
browser display both the image and the alt text. And maybe title text too.

But naturally the _meaning_ of an alt attribute is to specify the text to be
used in place of the image when the image is not presented. It might also be
made to appear when the image _is_ presented, which is worth knowing, but we
should not design alt attributes specifically _for_ such situations.

--
Jukka Korpela
TIEKE Tietoyhteiskunnan kehitt