The HTML <map> tag is used for declaring an image map.

The <map> tag is used in conjunction with the <area> tag and <img> tag to specify clickable areas (sometimes referred to as "hot spots") on an image.

To create an image map, you use the <map> tag to declare the image map, and the <area> tag (nested within the <map> tag) to define the clickable areas. The <img> tag can be defined elsewhere on the page, and is linked to the <area> element using the ID attribute.

Required Attributes

  • id is used to uniquely identify the element.

Optional Attributes

Example

<map id ="atlas">
	<area shape ="rect" coords ="0,0,115,90" href ="northamerica.html" alt="North America" />
	<area shape ="poly" coords ="113,39,187,21,180,72,141,77,117,86" href ="europe.html" alt="Europe" />
	<area shape ="poly" coords ="119,80,162,82,175,102,183,102,175,148,122,146" href ="africa.html" alt="Africa" />
</map>

Changes in HTML5

  • None.

Related Tags