Accessibility: alt or alt="" for decorating images
P粉364129744
P粉364129744 2024-02-03 21:18:47
0
2
412

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?

P粉364129744
P粉364129744

reply all(2)
P粉151720173

They are the same: https://stackoverflow.com/a/44764507/18717610 Screen readers will not read images with empty alt attributes.

P粉850680329

Both should be treated equally.

According to HTML standard:

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template