When should I use a “null” or empty alt tag?
Question
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.
Free Tools to Continue Learning
Accessible Web RAMP
Monitor your website and manage your progress towards WCAG conformance.
Accessible Web Academy
Career specific courses to help power up your accessibility knowledge.