When we use attribute alt=" " | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When we use attribute alt=" "

about <img>

17th Jul 2017, 3:38 PM
Milad Nazari
Milad Nazari - avatar
3 Answers
+ 4
'alt' attribute provide description of image... valid html require it, even you set it with an empty string (but it's not advised and should be reserved for layout decorative related ones: the rule you can follow is to ask you if blind people would need to have image described for 'read'/understand your content (voice synthetizer could so describe correctly the context of page)...
17th Jul 2017, 3:55 PM
visph
visph - avatar
+ 1
using alt is what will show up if the image is not found -- usually gives a description of what the image is
17th Jul 2017, 3:50 PM
S C
+ 1
If the image can't be found or loaded, it'll display whatever text you put inside of it. Alternate to the image.
17th Jul 2017, 3:51 PM
AgentSmith