Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

decorative-image

Rule Severity : Moderate

Description

Decorative images do not add meaningful content to a web page. They convey information that is already provided through other content. To prevent assistive technologies from announcing them unnecessarily, decorative images should be marked and hidden from assistive technologies.

Users with visual impairments rely on screen readers to navigate websites efficiently. If decorative images are not correctly marked, screen readers may announce them, adding unnecessary auditory clutter and disrupting the user experience.

With this rule, BrowserStack AI helps you identify decorative images on your web pages.

Examples

The following example includes an alt text for a purely decorative image (an icon for Accessibility Testing), causing screen readers to read it aloud. If such a case exists in your web page, BrowserStack AI identifies it and suggests you to fix it.

A screenshot of accessibility icon highlighted next to a text Accessibility Testing.

Incorrect Sample
Copy icon Copy

In the following corrected example, the image is accurately marked as decorative by using an empty alt attribute, ensuring that screen readers ignore it.

Correct Sample
Copy icon Copy

How to fix?

The first step to fix violations of decorative-image rule is to identify whether the images in your website are decorative or not.

You can detect decorative images by checking if the meaning of the conveyed information changes or if any information is lost if the image doesn’t exist. For instance, consider an image decorative if it only increases a link’s or button’s clickable area.

Refer to this Web Accessibility Initiative tutorial for more guidance on decorative images.

After identifying decorative images, use one of the following methods to mark it as decorative:

  • Assign the null alt attribute (alt="") to purely decorative images.
  • Use role="presentation" to indicate that the image should be ignored.
  • Implement decorative images as CSS background images.
  • Remove the <title> attribute or keep it empty.
  • In case of an svg, remove the <title> tag inside the svg, if it exists. Remove role="img" and add role="presentation".

References

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle