Skip to main content

HTML Guide

An “img” element which has an “alt” attribute whose value is the empty string must not have a “role” attribute.

When an img element has an empty alt attribute, its role is implicitly decorative, so it must not specify a role attribute.

Learn more:

Last reviewed: October 27, 2022

Was this guide helpful?

Related W3C validator issues