开发者

Alt attribute in img tag html error

when i put value in alt attribute in img tag it doesn't app开发者_StackOverflow社区ear over the image.I am using IE8. thanks.


Use title. alt is meant to be shown when the image cannot be downloaded (also used by screen readers).


That's how it's supposed to work. If you are asking "how do I make a tooltip?" then the answer is to use the title attribute.


it doesn't. The alt text is displayed only if the image can't be loaded for some reason or another (e.g. wrong file path, corrupted, etc.)


The alt attribute is an an alternative if for some reason the user is unable to view the image. Some browsers have chosen to display the alt tag in a similar way to how the title attribute is used. To test it, change the src of the image to be incorrect and you should see the alt text.

See W3Schools - ALT Attribute for more details

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜