+ 1

Why do we have to add ......alt=""/> when adding image in html?

1st Mar 2017, 10:26 AM
usherkoli
usherkoli - avatar
3 odpowiedzi
+ 4
Alt is used for displaying text if the image fails to load as well as display the text when a user hovers over the image (if the image loads)
1st Mar 2017, 2:21 PM
Chirag Bhansali
Chirag Bhansali - avatar
2nd Mar 2017, 7:08 AM
visph
visph - avatar
0
<img src="cat-photo.jpg" alt="photo of my cat"> if the image is not found at SRC (source) it would simply display the alt (alterntive) which is the text "photo of my cat"
1st Mar 2017, 1:55 PM
Andre Littiere
Andre Littiere - avatar