Today I Learned - Rocky Kev

TIL Decorative Images

POSTED ON:

TAGS:

Decorative images don’t add information to the content of a page.

For example, the information provided by the image might already be given using adjacent text, or the image might be included to make the website more visually attractive.

For example:

You should add an empty alt attribute (alt="").

Screen readers also allow the use of WAI-ARIA to hide elements by using role="presentation". However, currently, this feature is not as widely supported as using a null alt attribute. This allows you to search for images on the site with empty or missing alt attributes (so you can fill them in), but if they have role="presentation" you know you can skip over them as they are purely decorative.

via W3C - Decorative Images

via 101 Digital Accessibility (a11y) tips and tricks


Related TILs

Tagged:

TIL aria-expanded for showing when things are hidden/shown

The aria-expanded attribute is set on an element to indicate if a control is expanded or collapsed, and whether or not its child elements are displayed or hidden.

TIL ARIA role presentation

Think of this as a reset. You use role=presentation to remove semantic meaning from an element.

TIL reduce-motion-blur

Dizziness and vertigo are symptoms of a vestibular balance disorder. If the user has set up a user preference that they prefer motion-based animation be disabled/reduced, we can tap into that. As web developers, we can also support them.