Home  >  Q&A  >  body text

Accessibility: alt or alt="" for decorating images

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粉364129744P粉364129744258 days ago349

reply all(2)I'll reply

  • P粉151720173

    P粉1517201732024-02-04 14:55:53

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

    reply
    0
  • P粉850680329

    P粉8506803292024-02-04 09:48:15

    Both should be treated equally.

    According to HTML standard:

    reply
    0
  • Cancelreply