Part of a Whole

My name is Nicolas Steenhout.
I speak, train, and consult about inclusion, accessibility and disability.

Listen to the A11y Rules Podcast. And become a patron on Patreon.
Become a Patron!

Of alt text and cartoons

A recent Twitter conversation about XKCD comics show there is confusion as to what “alt text” is for images. The alt text should provide information about the image so that screen reader users can access the information in the image.

The Tweet

Here is the tweet that grabbed my attention. As there is no alt text provided, I will write some and provide it below the embedded tweet, for all to see.

Alt text for cartoon

Cartoon with two panels. Both panels have a man and a woman looking through telescopes pointing up. Each panel has the night sky with a crosshair in the middle, as if it was seen through the telescope. The first panel is title "What people imagine astronomers observing a conjunction are like. The man says "6.15 arcminutes!. The woman says “Stupendous! This confirms Einstein!”. The second panel is title “What they’re actually like”. The man says “Wow! Look how close they are! Now kiiiissss!!”. The woman says “It’s so cool!! Doooo iiit!”.

Alt text bot

This is the tweet from the XKCD alt tweet bot.

There’s nothing relating the text from the alt tweet bot to the actual content of the cartoon.

The problem

When blind screen reader users see “alt text”, they assume that the alt text will represent what is seen in the image. In this case, the “alt text” is an “added joke”, as per Ed Hurtley. The text the alt text bot pulls from is actually the title attribute of the image on the XKCD website.

So the website is providing more of a joke to the comic for sighted users that hover their mouse over the cartoon, and for some screen reader users, if their assistive technology, browser, and settings don’t cause conflict resulting in that attribute being ignored.

But even if blind screen reader users are able to get to the title attribute, they aren’t likely to realize that this is not, actually, the text in the cartoon.

The unofficial XKCD alt text bot account to providing the title attribute rather than actual alt text is misleading. If it’s going to be called “alt text bot”, it should provide alt text. Otherwise call it “title attribute text bot”.

The comic

But the alt text bot doesn’t have much to pull from. Because the website for XKCD uses the cartoon title as alt text for the image. This cartoon is called “Conjunction”.

<img src=”//imgs.xkcd.com/comics/conjunction.png” 
title=”The IAU is sad to announce that at 00:39 UTC on December 22nd,
Jupiter and Saturn did unfortunately come into contact,
and appear to have blooped together.”
alt=”Conjunction” srcset=”//imgs.xkcd.com/comics/conjunction_2x.png 2x”
style=”image-orientation:none”>

This use of the alt attribute is far from great. It provides zero information about the comic itself.

What should be provided

Providing another layer of joke through the title attribute is kinda fun for those in the know. But proper alternative text to the image should be provided for those who rely on assistive technology to perceive images content. And if XKCD provided proper alt text, the XKCD bot could pull that and display it as actual alt text in Twitter. Then the “alt text bot” could provide the added joke from the title attribute. Though the bot really needs a different name!

More info about alt text

If you need to figure out what to use as alt text on an image, there’s a great alt text decision tree on the W3C website.