In terms of WCAG 2.0 accessibility, if I write alt
or alt=""
in the html, are empty alt tags equally valid?
like this:
<img src="some-image.jpg" alt=""> <img src="some-image.jpg" alt>
Are they all valid for illustrating decorative images?
Inspecting the image using alt=""
in the browser's dev tools will show alt
, so will just writing alt
in the html work?
They are the same: https://stackoverflow.com/a/44764507/18717610 Screen readers will not read images with empty alt attributes.
Both should be treated equally.
According to HTML standard: