Search code examples
htmlwcag2.0

Accessibility: alt or alt="" for decorative images


In terms of WCAG 2.0 accessibility, is an empty alt-tag equally valid if it's written alt or alt="" in the html? Like this:

 <img src="some-image.jpg" alt="">

 <img src="some-image.jpg" alt>

Are they both valid for stating decorative images?

Inspecting an image with alt="" in a browser's DevTools will display alt, so is it valid to just write alt in the html?


Solution

  • Both should be treated equally.

    According to the HTML Standard:

    Empty attribute syntax

    Just the attribute name. The value is implicitly the empty string.