why should we use alt in IMG tags | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why should we use alt in IMG tags

10th Nov 2016, 6:56 AM
Balaji Narasimhan
Balaji Narasimhan - avatar
7 Answers
+ 3
because if browser does not support images, then it will display alt text instead of image
10th Nov 2016, 7:01 AM
Harish Nandoliya
Harish Nandoliya - avatar
+ 2
You don't technically need it, but you should ALWAYS include it in your code so that people with disabilities can take advantage of it with text to speech browsers. For example if they were blind that alt information would be very useful.
10th Nov 2016, 7:10 AM
J.C Vega
J.C Vega - avatar
+ 2
If the image didn't load for the user (internet connection failed, image was deleted or any other reason) the ALT attribute will show text(or the thing you want) for the user instate of the original image. Hope I helped ^_^
10th Nov 2016, 6:24 PM
Ahmed Abdelwadod
Ahmed Abdelwadod - avatar
+ 1
Ahmed is right. In addition, some people turn off the images from displaying to speed up page loading time and save more internet data. The text inside the ALT attribute will be displayed in those cases. The user may turn on image display to see that image if they are interested
16th Nov 2016, 11:08 AM
Core i9
Core i9 - avatar
+ 1
if image is not displayed in a browser for whatsomany reasons it might, alt attribute will display a text stating that this is an image. just give an alternative way to provide an information of the image if doens't display alt is mentioned. Having said that, However it's not mandatory to include alt
19th Oct 2017, 7:07 PM
Tejkumar Kempaiah
Tejkumar Kempaiah - avatar
0
Hollo,l am Chinese and I like java . l want to study English . Could you help me?
16th Nov 2016, 2:59 PM
lilei
0
Thank you
26th Apr 2020, 11:33 AM
Safrin Nihar