There is an argument raging right now about the HTML5 spec’s proposal that alt text on the
img element be optional. The rationale is (I think) that some authoring tools do not allow authors to add alt text, so alt should be not be required for conformance with the spec.
I disagree. As Gez Lemon says, “when an authoring tool doesn’t have anything useful to put in for the alt text, the tool shouldn’t put anything in. A good authoring tool will check for missing alt text and offer to assist the user in repairing the content”. If you choose to use a crap authoring tool, then you will author non-conforming code (should you even care). The conformance bar shouldn’t be lowered to cater for rubbish authoring tools—or ignorant authors.
But as the argument has raged tediously this way and that, people have started to consider photo sharing sites and their use of alt. A site, like Flickr, where you can load up your photos and organise them is an authoring tool: it allows you to author a web page that’s a photo album. Photo sites should therefore confirm to the requirements of the Authoring Tool Accessibility Guidelines.
So, it’s argued by many who believe that alt text should be a mandatory attribute of the img tag, each of these sites should prompt the user for an alternative description of the photo they’re uploading.
But should they?
What’s alt text for?
Now this is really accessibility for beginners. It’s my first slide when I do “What is accessibility?” talks at conferences. But, like everything else in the merry world of accessibility, it’s not quite as simple as it seems.
The HTML 4 spec says
Several non-textual elements (IMG, AREA, APPLET, and INPUT) let authors specify alternate text to serve as content when the element cannot be rendered normally. Specifying alternate text assists users without graphic display terminals, users whose browsers don’t support forms, visually impaired users, those who use speech synthesizers, those who have configured their graphical user agents not to display images, etc. Source: HTML 4 spec
So let’s all agree that alt text is to “assist”. It’s there to help, not get in the way. Because of this, alt text describes the function of the image, not what it looks like.
It’s the same thought process as writing semantic mark-up. I use the Bruce Mantra: “It’s not what it looks like that matters, it’s what it is“.
Alt text for homepage links
A good example of this is the very common practice of having a corporate logo in the header of the page, which links back to your home page. The alt text here should not describe the image, but give its function, which—in this instance—is a link to the homepage.
So you don’t describe your logo with alt=”Bright red rampant unicorn pleasuring a walrus, with a nice ‘wet floor’-style reflection below to show we’re Web 2.0″, you simply write alt=”home”. If you don’t, you fail to assist the screenreader user, as they still can’t find the home link, and will soon get tired of hearing about unicorns and walruses at the top of every page.
(If you put no alt text at all, a screenreader user will hear either the filename of the image, or the URL of the link. This is no great problem if the filename is “logo.gif” or your homepage is “index.html”, but it can be a right bugger with big CMS-generated sites. Imagine listening to this example I picked at random from eBay today (line breaks inserted):
<img src="http://thumbs.ebaystatic.com/pict/280234051028.jpg" ></a>
So far, so uncontroversial.
Alt text for graphs
Here’s a slightly less clear-cut example, but still pretty uncontroversial. You have a graph that shows that Rampant Unicorn Inc has a 97% market share, while Flaccid Faun Inc only has 3%, so it’s easy to write the alt text.
But what should you do if the surrounding article makes it clear in the text? If the graph is a supplementary visual that gives the same information again, I give it null alt text (alt=”") because repeating the market share figures in alt text is unlikely to assist a screenreader user; in fact, it’s likely to irritate them. Why repeat yourself?
Alt text on photos in articles
Here’s a greyer area still. You have a news item on your corporate site about your C.E.O. being knighted by the Queen and include a photo of him beaming proudly. Does the photo add any information to the piece? I believe that it doesn’t so it needs null alt text rather than alt=”Rampant Unicorn CEO, Bruce Lawson, beams proudly”.
We’re in the territory where it’s very difficult to make rules. In the CEO knighthood example, the image is just decoration: eye-candy to break up the slabs of text. It’s easy to imagine a different situation; a news story about some celebrity plastic surgery with a before and after photo would be carrying information in the images and would probably require alt text.
In this situation, the function of the image is related to the visual content. The “before” picture might say “Bruce Lawson, a portly gentlemen with grey hair and a defeated expression, looking every day of his 29 years” while the “after” picture might say “Bruce Lawson, wearing a dayglo pink diamanté dress, a tiara on his blonde beehive hair, his lips enhanced by collagen and painted glossy red, shows his fabulous new 40 DD bustline”.
The function of images on photo sharing sites
We’ve established that alt text is related to the function of the image and that occasionally it’s necessary to describe an image to explain how it supports the surrounding text or fits into its wider context.
But what is the function of a picture on a photo sharing site? There is no narrative context for the pictures – they are posted as visual artefects, complete in and of themselves.
What is the function of a set of pictures of the same event or same person? It’s certainly possible to write alt text for each picture, describing each image and how it differs from the other, similar pictures.
Take a look at my photos of some punk kids on flickr.
That’s a picture of a small boy with mohican hair and dark glasses – and, at a pinch, that could be the rudimentary alt text. But the function of the picture is its visual content, so wouldn’t we need to discuss the freckles, the slightly gawky grin, the chocolate smudge around his mouth?
Here’s a picture taken slightly later, from a slightly different angle, of the same child:
How would the alt text differ here? How would you write alt text for each subtly different shot if you had taken dozens of pictures?
Crucially: even if people had enough time, imagination and motivation to craft individual alt texts for each photo they upload (and no-one has), does it actually help a person with a visual impairment enjoy that photograph (assisting the user is what the spec describes as the purpose of alt text, remember)?
It’s worth looking at a post to the public HTML mailing list by Michael A Squillace, a blind participant:
Responding, here, as a totally blind web content consumer and not as a member of the IBM Human Ability & Accessibility Center, you can put all of the alt tags on flickr that you desire – I’m still not going to visit it because photos are inheritly visual entities. For the dozen or so photos that have received thousands of views (and that, presumably, resemble the news broadcast rather than the private telephone call), 100 or 150 characters of alt text is not going to make the photo any more useful to me. Are we next going to suggest that all of the songs available on the web need closed caption so that deaf folks can enjoy them, too? As someone who is blind, I realized a long time ago that photography, driving, and painting are endeavors in which I am simply not going to engage and I think it detracts from the conversation about the real utility of alt to concentrate on what I see as, indeed, an edge case. Of course, I am only one person and I’m sure that many of my colleagues and fellow PWDs will vehemently disagree with me. (Source: W3C HTML list)
I’m about to get my arse roasted by flames when I publish this, but that’s why I use null alt text for the vast majority of my pictures in galleries.
Or am I evil and wrong?