Skip to main content
Accessibility (A11y) – Complete Beginner to Advanced Guide
CHAPTER 12 Beginner

Images, Icons, and Media Accessibility

Updated: May 16, 2026
25 min read

# CHAPTER 12

Images, Icons, and Media Accessibility

1. Introduction

The web is an intensely visual and auditory medium. We use photography to evoke emotion, icons to save screen space, and video to tell complex stories. However, if these visual and auditory elements are not translated into accessible formats, you are effectively shutting off the lights and muting the volume for millions of users. A screen reader cannot interpret the emotional nuance of a photograph; it only reads the code you provide. A deaf user cannot absorb the message of an uncaptioned video. In this chapter, we will master Images, Icons, and Media Accessibility. We will learn the art and science of writing effective Alternative Text (Alt Text), understand when to explicitly *hide* decorative imagery from screen readers, and establish the non-negotiable requirements for video and audio multimedia.

2. Learning Objectives

By the end of this chapter, you will be able to:
  • Write descriptive, contextual, and concise Alt Text for informational images.
  • Identify "Decorative" images and use alt="" to hide them from screen readers.
  • Architect accessible Iconography that does not rely on visual recognition alone.
  • Enforce WCAG requirements for Video Closed Captions and Audio Transcripts.
  • Avoid the "Redundant Alt Text" cognitive trap.

3. Alternative Text (Alt Text)

When a screen reader encounters an <img> tag in the HTML, it looks for the alt attribute.
  • The Code: <img src="dog.jpg" alt="A golden retriever catching a red frisbee in a park">
  • The Purpose: It provides a text equivalent for visually impaired users. If the image fails to load for sighted users (due to a bad connection), the text will appear on the screen instead.
  • The Rule of Context: Alt text must describe the *purpose* of the image in the current context, not just literally what it looks like. If a photo of a padlock is used as a button to log in, the alt text should be "Log In," not "Silver Padlock."

4. Informational vs. Decorative Images

Not all images need Alt Text.
  • Informational Images: A chart showing sales data, a photo of a product you are buying, or an infographic. These MUST have highly descriptive Alt Text.
  • Decorative Images: A subtle abstract background pattern, a generic stock photo of a smiling person used purely for layout spacing, or an icon sitting right next to explicit text.
  • The Decorative Fix: You MUST use an empty alt attribute: alt="". (Do not delete the attribute entirely). When the screen reader sees alt="", it understands the image is decorative and completely skips it, saving the blind user from hearing useless noise.

5. Accessible Iconography

Icons are notoriously ambiguous. A floppy disk means "Save" to a 40-year-old, but means nothing to a 15-year-old.
  • The Text Rule: The most accessible icon is an icon with a visible text label directly next to it.
  • The Screen Reader Trap: If you have a standalone "Trash Can" icon to delete an item, the developer must use an aria-label="Delete Item" on the button. Furthermore, the developer must use aria-hidden="true" on the physical <svg> icon itself, so the screen reader doesn't try to read the raw SVG code.

6. Video and Audio (Captions and Transcripts)

WCAG 1.2 is entirely dedicated to Time-Based Media.
  • Closed Captions (CC): Every single video containing spoken dialogue MUST have synchronized captions. This is non-negotiable for deaf users, and heavily utilized by users in public spaces.
  • Audio Descriptions: For blind users, if a video contains vital visual information (e.g., a silent text card appears on screen saying "Sale ends Tuesday"), the video must contain an audio track where a narrator reads that text aloud.
  • Transcripts: Any podcast or audio-only file must be accompanied by a full text transcript. This is necessary for deaf-blind users and massively improves SEO.

7. Diagrams/Visual Suggestions

*Visual Concept: The Decorative vs. Informational Alt Text* Provide a 2-panel comparison.
  • Panel 1 (Informational): A photo of a specific pair of Nike shoes on an e-commerce page. Code: alt="Nike Air Max 270 in Black and White".
  • Panel 2 (Decorative): A generic stock photo of a laptop next to a massive text block that reads "Our Services." Code: alt="".
This clarifies the cognitive difference between crucial data and visual fluff.

8. Best Practices

  • Do Not Start Alt Text with "Image of...": The screen reader already announces the element as an image. If you write alt="Image of a dog", the screen reader will say: *"Image, Image of a dog."* It is annoying and redundant. Just write "A dog."

9. Common Mistakes

  • The "File Name" Disaster: If a developer forgets to add the alt attribute entirely (not even alt=""), many screen readers will attempt to help the user by reading the raw filename of the image. The blind user will suddenly hear: *"D-S-C-underscore-8-4-7-2-dot-J-P-G."* This is a catastrophic UX failure and causes immense cognitive friction.

10. Mini Project: Write Contextual Alt Text

Let's practice writing for the ear, not the eye.
  1. 1. The Image: A magnifying glass icon.
  1. 2. Context A: The icon is inside a search bar. The correct Alt Text is not "Magnifying glass." It is alt="Search the website".
  1. 3. Context B: The icon is on a biology website next to a paragraph about laboratory equipment. The correct Alt Text is alt="A brass magnifying glass".
  1. 4. *Result:* You have learned that an image has no inherent meaning; its meaning is dictated entirely by its context within the UI.

11. Practice Exercises

  1. 1. Define the difference between an "Informational Image" and a "Decorative Image." Why is it a best practice to explicitly use an empty alt attribute (alt="") for decorative images rather than writing descriptive text?
  1. 2. Explain the redundancy error regarding Alt Text. Why should you never begin your Alt Text description with the phrase "An image of..." or "A picture of..."?

12. MCQs with Answers

Question 1

A developer is placing a generic, abstract geometric background pattern onto a website purely for visual aesthetic purposes. It conveys absolutely no information. To ensure a screen reader handles this image correctly and does not waste the blind user's time reading raw filenames, what specific code must be applied?

Question 2

When designing a standalone icon (e.g., a "Trash Can" icon) to act as a button without any visible text next to it, what is the required accessibility architecture to ensure a screen reader user understands what the button does?

13. Interview Questions

  • Q: A client hands you a photograph of a red sports car. Walk me through how the "Alt Text" for this exact same image would drastically change if it was used on a Car Dealership e-commerce page versus if it was used as a generic header on an auto insurance blog.
  • Q: Explain the catastrophic UX failure that occurs if a developer completely forgets to include the alt attribute (not even alt="") on an <img> tag. What exactly does the blind user hear?
  • Q: Walk me through the WCAG requirements for Time-Based Media (Video). If you are putting a marketing video on your homepage, what are the three accessibility deliverables you must provide to ensure the video is compliant?

14. FAQs

Q: How long should Alt Text be? A: Concise. Ideally, under 125 characters. If the image is incredibly complex (like a massive infographic charting 10 years of financial data), do not try to cram it into Alt Text. Write a short Alt Text (e.g., "Financial chart for 2010-2020"), and then provide the full data table in the main HTML text below the image.

15. Summary

In Chapter 12, we mastered the translation of the visual into the verbal. We learned that to a screen reader, an image is a black hole unless we illuminate it with precise, contextual Alternative Text. We wielded the empty alt="" attribute as a scalpel, surgically removing decorative visual noise to protect the cognitive load of our blind users. We fortified our ambiguous iconography with explicit ARIA labels, and we established the non-negotiable legal mandates of Closed Captions and Transcripts. By ensuring that every pixel of media has a text equivalent, we guarantee that our digital stories are experienced by all.

16. Next Chapter Recommendation

We have made images and text accessible. Now we must dive into the complex interactivity of the components that hold them. Proceed to Chapter 13: Accessibility in UI Components.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·