For visitors with visual impairments, alt text is essential. It allows screen readers to describe what's in an image, making your content accessible to everyone.
But writing good alt text isn't just about accessibility; it's a hallmark of good content. The good news is that a few practical tips make it much easier.
Alt text vs. caption: what's the difference?
These two are often confused, but they serve distinct purposes:
- Alt text: Describes what can be seen in. Only displayed if an image fails to load, but is always read aloud by screen readers.
- Caption: Provides additional context or credit, such as names, locations, or the photographer's name. It is always visible, typically below the image.
Here’s an example:
Alt text: 'A middle-aged man with a moustache looks at the camera. He is wearing a suit and tie and is standing in front of a bookshelf.'
Caption: 'Albert Einstein. This photo was taken in 1916 when Einstein visited his friend Paul Ehrenfest in Leiden.'
Tips for writing alt text
The golden rules
- No alt text is better than bad alt text. If an image is purely decorative, it's best to leave the alt text empty.
- Keep it concise. One or two sentences are usually enough. Don't overcomplicate it.
- Use the same language as the main content on the page.
Do's and don'ts
Do:
- Describe the most important element of the image first.
- Include any text that appears within the image.
- End with a full stop. This signals to screen readers that the description is complete.
- For functional images (like a logo that links to the homepage), describe the action (e.g., 'Link to the homepage').
Don't:
- Start with 'Photo of' (except with logos, illustrations or artworks).
- Repeat the caption or surrounding text.
- Add alt text to purely decorative images.
When not to use alt text
Some images don't need alt text. This applies to:
- Decorative images that add no new information.
- Images used for visual styling that do not add meaning to the content.
- Images where the information is already fully described in the surrounding text.
Your pre-publication checklist
Before you hit publish, run through these questions:
- Does the description start with the most important information?
- Is it understandable to someone who cannot see the image?
- Does it repeat information from the caption or body text?
- Does it end with a full stop?
- Is this a decorative image that doesn't need alt text?
More information about alt text
There are many excellent resources online. Try searching for 'alt text best practices' or 'writing effective alt text' for more examples and in-depth guides. Writing great alt text is a skill that develops with practice – and your audience will thank you for it.
Log in om een reactie achter te laten of registeer je.