1.3. Meaningful images
Introduction
"One image is worth a thousand words", they say.
Images help us to understand better some content. They are especially useful for people with cognitive and learning disabilities.
However, inaccessible images can create major barriers for people with visual disabilities. Accessible images will benefit not only them but also the Search Engine Optimization (SEO) of a website.
We know that every <img>
must have an alt
attribute. However, it doesn't need to be used equally everywhere.
In the same way, there are different images concepts, we can also describe them in different ways.
For example, if the image doesn't add any relevant information about the content, we can just leave an empty alt: alt=""
.
Exercise
In the exercise page, there are 4 visual representations, but none of them are accessible.
๐ฏ Goal: Add the needed accessible descriptions to each image.
Tip 1: Alt text - Replace the image src
with an invalid URL and see how the browser renders a broken image. Does the alt text make sense?
Bonus
In slow internet connections, images take time to load. Some people even prefer to disable images to save bandwidth data.
๐ฏ Goal: Edit the CSS to ensure the page looks good when images don't load.
๐ Tip #1: In your daily job, take this as an opportunity for developers and designers to collaborate!
๐ Tip #2: In real projects, we can block all images, like this:
- In Chrome, go to DevTools > 3 dots (top right) > More tools > "Network request blocking".
- A new container in the bottom is opened.
- Add a new blocker: Click "+" button, write
*.jpg
and save it. - Refresh the page and voilรก. The images are not loaded!
Further reading
- Images concepts
- Alt usage - Decision tree
- Writing great alt text: Emotion matters
- Pros and cons of alt text
- Use CSS to detect invalid alt
WCAG Success Criterion
Exercise takeaways
(After the exercise) Reveal takeaways
- Empty alt (
alt=""
) is always better than an unexistent alt. - Alt is meant to be read by people, NotARobotImage.
- As a designer, go beyond the ideal state โ Include design skeletons to be shown when the images are still loading.