Adrian is displeased, as he dislikes people referring to a HTML attribute as something it clearly is not
alt=”” empty, null
With the alt attribute you can provide a text alternative to represent the meaning of the visual content in an in the context of its use or to signify the img can be safely ignored.
In a context where the image is considered decorative or contains information provided in text elsewhere in the same context, the alt attribute may be empty.
equivalents can be confusing
In modern browsers (except Firefox):
alt=”” is mapped to role=”presentation|none”
alt=”” on an has the same effect as:
Which means that the img element is removed from the accessibility tree, (except in Firefox where alt/alt=”” results in the img being present in the accessibility tree with an accessible name =””)
no alt is equivalent to
Which means that the img element is present in the accessibility tree but has an accessible name =”” (except for Firefox where the accessible name=null for alt, aria-label=””, and aria-labelledby=””)
What’s it all mean?
If you have an img that you consider decorative all of the following are methods that will have the desired effect of hiding the img from screen readers: alt, alt=””, role=”presentation|none”, and aria-hidden=”true” and [...]