English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
If the image cannot be displayed, the alt attribute specifies alternative text for the area. If the user cannot view the image for some reason (due to slow connection speed, incorrect src attribute, or using a screen reader), the alt attribute provides alternative information for the image.
Image map with clickable areas:
<!DOCTYPE html> <html> <title>HTML: <area> alt attribute - Basic Tutorial Website oldtoolbag.com</title> <body> <p>Click on the sun or one of the planets to observe it closely</p> <img src="planets.gif" width="145"height="126"alt="Planets" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126"href="sun.html" alt="Sun"> <area shape="circle" coords="90,58,3"href="mercur.html" alt="Mercury"> <area shape="circle" coords="124,58,8" href="venus.html" alt="Venus"> </map> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the alt attribute.
If the image cannot be displayed, the alt attribute specifies the alternative text for the area.
If the user cannot view the image for some reason (due to slow connection speed, src attribute error, or the user uses a screen reader), the alt attribute provides alternative information for the image.
If the href attribute exists, the alt attribute is required.
In HTML 4.01the alt attribute is required.
In HTML5In the syntax, the alt attribute is required only when the href attribute exists. If the href attribute does not exist, the alt attribute should not be used.
<area alt="text">
Value | Description |
---|---|
text | Specify alternative text for the area when the image cannot be displayed. |