0
Why do we need to write "alt" when adding images in HTML?
3 ответов
+ 5
if the image has incorrect location or it is not displaying or user device doesn't support image.
then the image will replaced by the text inside the alt attribute
+ 3
I think the best point for using alt is accessibility. alt attribute plays vital role for SEO, search engine, web crawler, screen reader etc.
For example blind people can see the image, they use screen reader. So if you use alt attribute, screen reader will read the alt value (if any presents) so that the user can understand the context of the image
+ 1
Another reason is good for SEO, search engines do not read and understand your images unless there is a description provided in alt.