alt text

My blog just turned 1, I've written more than 150 articles, I've written about semantics, ids and classes, margins vs paddings, floats and many more. I've written guest posts and my articles have been mentioned by others. The visitor count is rising and so are the rss stats. Still, my work blog is not complete, but today I'm going to fix that. Presenting my article on ... alt text. A true web dev blog classic.

the alt joke

There are two web developers sitting at the bar. Suddenly the junior developer asks the senior:

Junior: What's all this fuzz about alt text on images.

The senior developer bolts up, flings in a feverish frenzy and starts blabbering away. After five minutes he slushes back into his seat, takes a sip of his beers and answers:

Senior: So ... yeah.

the alt text issue

Alt text became a big issue when the accessibility wave started. Blind people aren't able to perceive images, and thus these images should receive a text alternative. It sounded simple, but soon things became a lot more complicated than people had expected.

Over-eager developers started adding alt values to every image within the html, also to images that were purely there for presentational purposes (those were the days, right). A separator image defined in html was blessed with an alt text like "separator image". Of course, your average screen reader user wouldn't give a damn about information like that, so developers were quick to change their preaching of alt text.

And so we were left with the advice that only images with added value should receive an alt text. If not, the value of the alt attribute should be left empty.

black shades

So here we are again, pretending to be the blind guy. Added value sounds pretty nice in theory, but when you sit down in front of an image and you try to figure out whether it has any added value for a screen reader user, it's easy to get stumped.

Of course, there are a few rules of thumb out there that might help you on your way. It's obvious that all presentational images should receive an empty alt attribute. Images that were put on a page to break long texts or to simply draw people in should probably receive an empty alt attribute too. As for all other images, Roger Johansson had some first class advise:

If you were to describe the document to someone over the phone, would you mention the image or its content?

A very helpful rule of thumb that brought me closer to deciding whether to include an alt text or not. Still, some gray areas remain.

asking questions

None of the methods you can come up with are fool-proof. If you only consider the images I usually add to my articles, you'll see it's not as easy to decide whether they need an alt text or not. Most of them are not informative at all, but they always include some kind of visual pun or visual relations to the article. If you take this article, you see a blurred image of a conversation, representing the gray are of what an image could communicate to the listener.

Not everyone will pick this up, sometimes these links are pretty far-fetched and you probably need a mindset pretty close to mine to get them all. But even if you would pick them up, would you mention this over the phone? And writing down the explanation of a pun is in itself killing the joke. So should I add an alt text?

Another issue I've been having is related to captions. I realize there's a subtle nuance between alt text and an image caption, but in many cases they pretty much say the same thing. The question is, would you include an alt text when you've already defined a caption for an image? I'd say no, but what if your image was taken out of its context (like google images?). Then you have a possibly informative image without a text alternative.

One final remark lies with screen reader users themselves. It's all nice and dandy if we decide an image doesn't need a text alternative, but with the current state of the web, will they trust us? Of course we can decide the image is of no use to them, but they have no way of checking if we are actually right, unless we tell them what is on the image. And since most sites don't even bother with such silliness, why would they trust us in doing the right thing when they visit our site? If I were blind and I ran into an image without a text alternative, would I be sure the web master intended it that way as to make my life easier?

the end

So did I solve any problems? Not at all, I just added some extra questions, which was the purpose of this article. It is hard to define the use of alt text, even in a perfect world, even after reading tons of articles and talking to a batch of experts. There is no definite answer I guess. I think it goes as far as saying it depends when someone was born blind or turned blind at a later age. My article will not be the last one on this subject, but I felt obliged to add my two cents.