HTML <map> Tag


The <map> HTML element serves as a container for the <area> elements that define the active areas for image maps. Such areas set invisible areas in the image, which are links to HTML documents. The purpose of using <map> is to associate an <img> element with a client image map. This relationship is determined by the use of a single identifier both in the <img> specified by the usemap attribute and in the <map> set by the name attribute.


Permitted Parents
Any element that accepts phrasing content
Block and <area>
Start/End Tags
Start tag: required, End tag: required


<img alt="Shapes" height="102" src="images/shapes.jpg" style="border: none;" usemap="#shapes" width="375" />
<map name="shapes" id="shapes">
<area shape="circle" coords="58,50,40" href="javascript:clicked_on('circle');" title="Circle" alt="Circle"/>
<area shape="rect" coords="136,11,227,89" href="javascript:clicked_on ('rectangle');" title="Rectangle" alt="Rectangle"/>
<area shape="poly" coords="309,13,358,89,257,89" href="javascript:clicked_on('triangle');" title="Triangle" alt="Triangle"/>
<area shape="default" nohref="nohref" title="Default" alt="Default"/>
function clicked_on ( clicked_shape )
alert ( "You clicked on the " + clicked_shape );


Attribute Definition
name Assigns a name to the image map.

Global Attributes

The <map> tag also supports the Global Attributes in HTML5

Event Attributes

The <map> tag also supports the Event Attributes in HTML5

Browser Support

The following table will show you the current browser support for the HTML <map> tag.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th March 2024