Accessibility Recipes/Images

From DPWiki
Jump to navigation Jump to search

What to do and how?

Alt

This section is incomplete, but some guidance is provided on the Accessible HTML eBooks#Alt_text page.

Longdesc

This historical attribute is now deprecated and should not be used.

Background Images

Background images (that is, those invoked using the CSS background-image: url(images/foo.png); property) cannot have alt attributes. So it is best not to use the background method for images that convey important content: use them only for "unimportant" images that are purely visual decoration. After all, not only blind users but anyone who has background image loading turned off or (usually) anyone who prints the book out will not see the background.

Why?

W3C:

  • WCAG 2.1, May 2025 Provide text alternatives for any non-text content so that it can be changed into other forms people need, such as large print, braille, speech, symbols or simpler language..
    • Success Criterion 1.1.1 Non-text Content: All non-text content that is presented to the user has a text alternative that serves the equivalent purpose, except for the situations listed below (only those relevant to our books are listed here).
      • Time-Based Media (e.g. recordings): If non-text content is time-based media, then text alternatives at least provide descriptive identification of the non-text content.
      • Sensory (e.g. recordings): If non-text content is primarily intended to create a specific sensory experience, then text alternatives at least provide descriptive identification of the non-text content.
      • Decoration, Formatting, Invisible: If non-text content is pure decoration, is used only for visual formatting, or is not presented to users, then it is implemented in a way that it can be ignored by assistive technology.

Who benefits?

Blind people using screenreaders or Braille displays, people on slow connections who may have images turned off, anyone with the misfortune to acquire your HTML file without the images that go with it.

Drawbacks

Generally none.

Testing

  • Turn off images.

Further Reading