DEV Community

Why is The "alt" attribute so important for images?

Belhassen Chelbi on December 18, 2017

Maybe it seems basic, but I remember when I used to ignore this attribute when Writing an image tag. You shouldn't do that for the following reason...
Collapse
 
meisekimiu profile image
Natalie Martin

The alt attribute is also important for things like logos or other stylized text put into images. It lets machines know what text is in your image which is very useful. Especially when using automatic page translation tools!

Collapse
 
belhassen07 profile image
Belhassen Chelbi

yeah so it's a lot more accessible , I mean you provide an alt in English and it can be translated to whatever language is, this really awesome when you think of it as providing information about an image for people who wan't see it, this is a justice tool.
Thanks for adding your great ideas mate ♥

Collapse
 
jenc profile image
Jen Chan

Just wanted to add it's also accessible because visually impaired users who use screenreaders will have the alt text read out loud when it's in focus, or text-to-speech is on.

Collapse
 
belhassen07 profile image
Belhassen Chelbi

I think I've mentioned the screen readers thing in the accessibility paragraph, thanks fake jen chan lol ♥