Wondering about alt attributes

Jump to menu

1 July 2003

Mark Pilgrim has emoticons on his weblog, pretty pictures that show up instead of the kludgy equivalents like :-). That is, if you’re both using a browser capable of loading images, and you then choose to load those images. If not, you should see the alt attribute of the image, assuming it has one. Being a champion of accessibility, Mark provides these textual replacements for the images. So :-) turns into a picture, with an alt attribute of ‘[smiley face]’ .

xiven does something similar, but the textual replacement is what you’d type, :-) (well, :) in this case; ye ken well what I mean).

As ever, there is a third way. Keith Devens uses what seems like horrible alternative, Smiley for your standard one, and then Smiley sticking out its tongue for :-p.

From these only the first two are viable. That is, do one of the following:

  1. Provide a description of the image, presumably better for users of screen-readers. For example, [smiley face].
  2. Provide a textual equivalent of the image, presumably better for users of text-only browsers/browsers with image loading turned off. For example, :-).

So which works better? I got the demos of JAWS and IBM Home Page Reader (40 MB!) and tried them out on a very short, very simple test page.

Style JAWS says IBM HPR says
dive into mark Graphic left-bracket smiley-face right-bracket Smiley face
xiven.com Graphic colon dash right-paren Colon dash
Keith Devens .com Graphic smiley Smiley

This tells me that first of all, I hate screen readers and I’m glad to have decent vision (despite reading and computing, no glasses!). Second, Keith’s looks horrible in a text browser, or in Firebird when the image doesn’t load, but sounds a heck of a lot better than the mess of punctuation available elsewhere.

I’m quite surprised, actually. As always, site authors have to tailor what they’re doing to their audience. I prefer xiven’s approach mainly because I’m more likely to have an image fail to load (this often happens to me) than use a screen reader (this is extremely unlikely). My main conclusion, though, is that accessibility, even for this stupidly trivial thing, is a pain.

(Just as I finished typing this, I got news that my game is ready. Now all that needs to happen is for it to be setup. Hoorah.)