When I give presentations on accessibility, I often get one or two questions I’ve fielded before. I’ve collected a handful for an ongoing series of posts with my answers. I hope it helps you understand accessibility better.
How do I handle alt attributes?
Alt attributes can trip up even the most seasoned web worker. But do them right, and they make a huge difference to screen reader users.
I like this table from an article by Whitney Quesenbery.
|If the image contains…||The alt text should…|
|Text||Repeat the text|
|Visual information||Explain it|
|Sensory information||Describe it|
|Nothing new||Keep it very short|
(if you can’t make it “null”)
If you want more explanation, check out the W3C’s alt decision tree.
All images should have an alt attribute, even if it’s empty or null, like:
Follow the series Accessibility Answers. Ask me a question via my contact page or Twiter.
Image by rawpixel.