Images that are central to the understanding of a publication must always include a text alternative in
their alt
attribute. In the case of complex images, a detailed description should also be
added.
If the image is purely decorative, the alt
attribute should be left empty. For improved,
accessibility, an ARIA role
attribute with the property presentation
should also be attached.
Note
If an image is important to the publication, but not required to be read at the point of insertion (i.e., it is not part of the logical reading order), use a figure tag to enclose it.
Note
The details
element has been removed from HTML5, but remains under development for HTML
5.1. It will allow a collapsible description when finalized, but is not recommended for describing
content at this time.
img
element