English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manuel de référence HTML

Complète des balises HTML

HTML: <map> balise

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>.

Exemple en ligne

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 ‹/›

Compatibilité du navigateur

IEFirefoxOperaChromeSafari

Most browsers currently support the <map> tag.

Tag definition and usage instructions

<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.

HTML 4.01 with HTML5differences

Note: In HTML5 In, if the id attribute is specified in the <map> tag, then you must also specify the name attribute.

Differences between HTML and XHTML

In XHTML, the name attribute has been deprecated, and it is replaced by the id attribute.

Attribute

AttributeValueDescription
namemapnameRequired. For image-map defined name.

global attributes

<map> tag supports global attributes, see the complete attribute table HTML global attributes.

event attributes

<map> tag supports all HTML event attributes.