Do I need to include alt in images

W3c indicates the use of alt for all images on a website to ensure accessibility. How can I set it for an image such as bullet in a javascript menu or background images or blank images (images used to get design or for general purposes)?

+4
source share
4 answers
Attribute

alt is required for <img> tags if you want your markup to be checked. Background images and bullets are just cosmetic, they do not need an alternative representation, since they are not part of the content.

+8
source

You set the alt attribute of the <img ...> to make the image accessible to people who use screen readers. Decorative images (for example, backgrounds and bullets) do not need to be described (it will simply be an obstacle for a visually impaired person using a screen reader), but if, for example, you received a graph, you must describe the information transmitted in the graph. If you need a lot of text to describe it, you use the longdesc attribute to link to a separate file that describes the image.

+2
source

Just describe the image. What will be clear to a person using a screen reader? Say it's a bullet or formatter, and the reader can safely ignore it.

0
source

The whole point of alt is to make your site accessible. If the image is important for your site (for example, a link posted by someone, mentioned in the text, etc.), you want everyone to know what it is and what is there. Bullet points and blank images do not meet these criteria, so you can simply leave them without alt s. Bullets in the "supposed" javascript menu are executed both in CSS and in the layout, so if you feel like jumping through several hoops, you can still get your code to check whether you consider it worthy.

0
source

All Articles