5.9 The Basics of Alt Text

Accessibility for the web is a topic I’m passionate about, and a majority of my web design or coding pet peeves negatively impact accessibility. One of the most frustrating things about bad accessibility practices is that a lot of good accessibility practices are actually easy to implement and aren’t all that time consuming. I can think of no better example of that than alternative text or alt text.

As Webaim.org’s 2019 article “Alternative Text” explains, alt text provides “a textual alternative to non-text content in web pages.” This article and this blog post only focuses on alt text images, but it can be applied to forms of media on the web. In the context of images, alt text will appear in place of an image on a web page if the reader has chosen not to view images or the image doesn’t load. But appearing in the place of images isn’t alt text’s only use as this figure from Seobility illustrates.

An blue, orange, and white illustration on a light blue background. There is a code snippet of alt text for images beneath an orange and white geometric illustration. There are three orange arrows beneath the code snippet that point to an image labeled "screen readers", an image labeled "search engines," and an image labeled "broken images."
A figure showing the alt attribute appears in HTML and how it has uses for search engines, screen readers, and broken images. Author: Seobility. License: CC BY-SA 4.0

Alt text is also read by screen readers in place of images. This makes the content and function of the image accessible to people with visual disabilities. Alt text also gives images a description that can be used by search engines, thus improving a website’s SEO.

Returning to WebAIM’s article on alt text, WebAIM emphasizes how alt text doesn’t necessarily always appear in the alt attribute in HTML. Alt text can appear in captions or a corresponding paragraph. That being said, WebAIM argues that context is vital when determining the most appropriate alternative text for an image.

This emphasis on context is one I agree with. If the function and content of an image already appears in a caption, then an alt attribute that repeats what’s in the caption would be redundant and unnecessary. Likewise, if an image only has a decorative function, such as a border or a divider, then an empty alt attribute (alt=””) would suffice.

WebAIM’s article on alt text is an invaluable resource because it provides plenty of examples to help readers get a good grip on alt text and the alt attributive and also provides a lot of tips and advice on alt text and the alt attribute. Did you find the article helpful?

Note: This chapter is a revised version of a blog post titled “The Basics of Alt Text” on Digital Media Miscellany.

 

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Publishing for the Web Copyright © by TCOM 3335 (Spring 2021 and Fall 2022) at UHD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book