+ 1

what is alt=""/>

<html> <head> <title>first page</title> </head> <body> <img src="http://www.sololearn.com/images/tree.jpg" alt="" /> </body> </html> yea its run but when i just remove alt=""> the image in unseen but why? so alt denotes something what is it

10th Apr 2017, 7:42 PM
Ashraful alam hridoy
Ashraful alam hridoy - avatar
5 Antworten
+ 4
"alt" attribute is a text value which will be displayed in case when image is not availabe in "src". In your case maybe image is not available so it would be dispaying "".. once u remove alt then there is nothing to show.
10th Apr 2017, 7:58 PM
Sbk0103
Sbk0103 - avatar
+ 1
alt is an attribute of img tag that displays an alternative text when (for any reason) the image is not showing. Note: it is important to ALWAYS define an alternate text, this is mandatory for all img tags, and this is why when you remove the attribute the image is not show. Always set an alternative text for images. In this example you could set: alt="tree" or any other descriptive words for your images.
10th Apr 2017, 8:02 PM
Jorge Escamilla
Jorge Escamilla - avatar
+ 1
Alt is there so if the picture cannot be displayed on a site, the person on the site sees text that describes the image.
29th Apr 2017, 6:30 AM
Arnav Shetty
Arnav Shetty - avatar
0
That's also for blind peoples to describe the website on their machine.
10th Apr 2017, 7:55 PM
Geoffrey L
Geoffrey L - avatar
- 1
That's why you need to be specific about the alt because we need the internet to be a weird and often disturbing place for the blind as well
10th Apr 2017, 7:58 PM
Cole Reizenberg
Cole Reizenberg - avatar