+ 4

What is alt="" ? Someone explain me its use please

2nd Jan 2017, 9:08 AM
Ayin GhaziMoradi
7 ответов
+ 13
It's the alternative text the user sees if the img is not loaded
2nd Jan 2017, 9:42 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 5
@ValentinHacker is right. And it is also used by screen readers to tell people who use them that there is an image. It's very comfortable for such user to follow the text contents.
2nd Jan 2017, 9:49 AM
Andreas K
Andreas K - avatar
+ 5
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img says: "This attribute defines the alternative text describing the image. Users will see this text displayed if the image URL is wrong, the image is not in one of the supported formats, or if the image is not yet downloaded. Browsers do not always display the image referenced by the element. This is the case for non-graphical browsers (including those used by people with vision impairments), if the user chooses not to display images, or if the browser cannot display the image because it is invalid or an unsupported type. In these cases, the browser may replace the image with the text defined in this element's alt attribute. You should, for these reasons and others, provide a useful value for altwhenever possible. Omitting this attribute altogether indicates that the image is a key part of the content, and no textual equivalent is available. Setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content, and that non-visual browsers may omit it from rendering."
2nd Jan 2017, 9:56 AM
visph
visph - avatar
+ 5
Valentinhacker and AKC right. alt="texts here to be shown" it's alternative text in case image is not available.
2nd Jan 2017, 2:01 PM
Sandeep Chatterjee
+ 4
It is named alternative text and it is used with the <img> tag. When the browser is unable to load the image the alt describes the picture with a word.
2nd Jan 2017, 3:49 PM
iamaprogrammer
+ 3
thank you all my friends!
2nd Jan 2017, 9:57 AM
Ayin GhaziMoradi
+ 3
It is named alternative text and it is used with the <img> tag. When the browser is unable to find the image the alt describes the picture with a word.
2nd Jan 2017, 3:48 PM
iamaprogrammer