When should I use a “null” or empty alt tag?
Question
I've read recently that there are situations where a null or empty alt tag is appropriate. In what situations should I use an empty alt attribute?
Answer
Alt tags are used to describe the contents of images, but some images don't convey any meaning and are therefore considered "decorative." Decorative images do not need to be announced by the screen reader, so if the alt attribute is empty (alt=""
, aka a "null" tag) it will not be announced to the user. An image with a "null" alt attribute is not the same as having no alt attribute. If there is no alt attribute on the <img>
element, the screen reader will announce the name of the image file, which may not make any sense to the user.
To learn more about accessibility considerations for images, explore the Accessibility Concepts for Marketing and Content Creators course from Accessible Web Academy. If you are a web design agency and are not part of our accessibility for agencies partner program, let's talk!