Alternative texts must be based on the context for best accessibility

Note: This post is older than two years. It may still be totally valid, but things change and technology moves fast. Code based posts may be especially prone to changes...

(Loaded 845 times)

Do not think that alternative text is a set and forget thing. Picture can mean different things in different contexts, so the alternative text must respect that.

I’ve seen this a lot – editor uploaded an image, set an simple and generic image description for it’s alternative text and used it whenever the image was used.

This is the easy way, and yes, we have the alt text and every automatic test is passing swell and the editor is probably satisfied.

But this can also be totally inaccessible!

All alternative texts must be always set to belong to current context, otherwise they can just add to the noise and really make things less accessible.

my thoughts

So – when you are adding a new image to your Content Management System and then adding the alternative text, maybe also description and title – you should think of alternative text also when you are including the image in an article. Especially when you are using same image in multiple articles and maybe even using images in links (and just to make it clear – alternative text in the image that is wrapped inside a link is defining the link text).

It can also be difficult sometimes, especially if the CMS is not enabling per-article alternative texts but just using the default image alternative text that was set after the upload. Then we have no choice – we must upload the same image twice, ideally with different file name too (based on the article context again). It is definitively not the best option when thinking about bandwidth, caching and other best practices, but I think we must prioritize users and therefore alternative texts that make sense by themselves and also when considering the context around them.

WordPress is supporting this with it’s Gutenberg concept and it is a very good thing. I’ve also seen the same in Sitecore and Liferay too. If you are using a CMS that is not supporting different alternative texts per image, please get in touch with the providers and they should be able to fix this for you!

WebAIM has a good explanation on the meaning of context for alternative texts (opens in new window).

Author: Bogdan Cerovac

I am IAAP certified Web Accessibility Specialist (from 2020) and was Google certified Mobile Web Specialist.

Work as digital agency co-owner web developer and accessibility lead.

Sole entrepreneur behind IDEA-lab Cerovac (Inclusion, Diversity, Equity and Accessibility lab) after work. Check out my Accessibility Services if you want me to help your with digital accessibility.

Also head of the expert council at Institute for Digital Accessibility A11Y.si (in Slovenian).

Living and working in Norway (๐Ÿ‡ณ๐Ÿ‡ด), originally from Slovenia (๐Ÿ‡ธ๐Ÿ‡ฎ), loves exploring the globe (๐ŸŒ).

Nurturing the web from 1999, this blog from 2019.

More about me and how to contact me: