English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
L'étiquette HTML <map> est utilisée pour définir une image map avec des zones cliquables (ou des points chauds). À l'intérieur de l'étiquette <map>, vous pouvez utiliser l'étiquette <area> pour créer des zones cliquables, et chaque zone cliquable peut avoir un lien hypertexte associé. Cette étiquette est également souvent appelée élément <area>.
Image map avec zone cliquable :
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Base Tutorial Website(oldtoolbag.com)</title> </head> <body> <img src="planets.gif" width="145" height="126" alt="Planètes" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" alt="Soleil" href="sun.html"> <area shape="circle" coords="90,58,3" alt="Mercure" href="mercur.html"> <area shape="circle" coords="124,58,8" alt="Venus" href="venus.html"> </map> </body> </html>Voyons le test ‹/›
IEFirefoxOperaChromeSafari
Most browsers currently support the <map> tag.
<map> tag is used for client-side image maps. Image maps are images with clickable areas.
The usemap attribute of the <img> tag must be the same as the name attribute of the <map> tag to establish a relationship between these two elements.
The area element is always nested inside the map element. The area element can define an area in the image map.
Note: In HTML5 In, if the id attribute is specified in the <map> tag, then you must also specify the name attribute.
In XHTML, the name attribute has been deprecated, and it is replaced by the id attribute.
Attribute | Value | Description |
---|---|---|
name | mapname | Required. For image-map defined name. |
<map> tag supports global attributes, see the complete attribute table HTML global attributes.
<map> tag supports all HTML event attributes.