+ 1
Why do we have to add ......alt=""/> when adding image in html?
4 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)
+ 3
Check my quote here:
https://www.sololearn.com/Discuss/238007/?ref=app
... from original source:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
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"