- Prevent users in environments where images are not seen (text browsers, screen readers or browsers with the images disabled) from being bothered by information about images that are unimportant to them.
- Provide only pertinent information to web crawlers.
- Improve the accessibility of content for people with disabilities.
- Improve the way content is taken into account by search engines and indexing tools.
In general, if a code (an HTML attribute, for example) is intended as an alternative, it must exist but be empty. For the most common cases:
- Give each decorative img element an empty alt attribute (alt="").
- Give each decorative area element an empty alt attribute.
- Leave empty the content of each object element in question (between the <object> and </object> tags).
- Leave the content of each canvas element in question empty.
- Do not give any svg element in question any ARIA attribute that gives it a label (aria-labelledby, aria-describedby, etc.).
This check is carried out in the HTML code generated using a code inspector or a dedicated toolbar:
- Test first for the presence of alt attributes by checking the validity of the HTML code generated, for example with the W3C validator (the HTML validator shows the private alternative images): each decorative image must have an alt attribute (present but empty).
- Check that each img image which does not convey information needed to understand the content has an empty alt.
- Check any other object type graphic objects, the content of the canvas between the opening and closing tags must be empty.
- Check any other elements of the svg type likely to receive an alternative via an ARIA attribute.
By Opquast - Read the license