WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: RE: alt="" vs alt=" "

for

Number of posts in this thread: 2 (In chronological order)

From: Jukka Korpela
Date: Tue, Apr 09 2002 1:13AM
Subject: RE: alt="" vs alt=" "
No previous message | Next message →

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

From: Jon Gunderson
Date: Tue, Apr 09 2002 9:15AM
Subject: RE: alt="" vs alt=" "
← Previous message | No next message

Jukka,
I think this is a great example of the types of things there are possible
for accessibility if browser developers would fully implement W3C
specifications.

Thanks,
Jon



At 11:10 AM 4/9/2002 +0300, Jukka Korpela wrote:
>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