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">
</map>
</>

Tag Uses

Specific uses of <map> tag

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

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.

Tag Attributes

Attributes that are applicable to <map> tag
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?