简体   繁体   中英

Alt attribute in img tag html error

when i put value in alt attribute in img tag it doesn't appear 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 (eg 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM