HTML map element

Html <map> tag represents an image map. It must be used with an img element to represent an image map. It should contain the area elements as children to specify areas on an image.


 <map name="shapes">
 <area coords="13,122,50,61,86,123"  href="files/triangle.html" shape="poly">
Try </>

Three area elements are used in a map. The area elements are representing triangle, square and circle respectively.

specific uses

It is used to make a map. For example, google map is the application of the map element.

Related tags

<img> img element adds an image in a page.
<img src=" address of the image" alt="alternate text" />
<area> area element specifies the area on an image to make a map.
<area href="address of the page/image" shape="circle" coords="196,89,33" />

Tag omission

Both opening and closing tags are necessary for the map element.

Global Attributes

All the global attributes are applicable on the map element.

Specific Attributes

name attribute serves as a unique id, then the image uses the value of this attribute in usemap attribute to access this map.
<map name="#shapes"></map>

Was this article helpful?




Get the newsletter