DEV Community

[Comment from a deleted post]
Collapse
 
alohci profile image
Nicholas Stimpson

To be honest, I'm more troubled by the empty alt attribute than the use of !important. !important just makes your own life harder. The empty alt makes some of your users lives harder.

Collapse
 
melnik909 profile image
Stas Melnikov

Which text would you use in this case ?

Collapse
 
alohci profile image
Nicholas Stimpson

"An example" maybe. Since you have used an <img> element in HTML and not a background image in CSS, you're indicating that it's content pertinent to the page. By adding an empty alt attribute, you're hiding that content from screen readers, so their users won't even know that an image is present. It's generally regarded that unsighted users should at least be aware of a image's presence so that they might discuss it with others.