HTML <map> tag
The <map> tag represents a map within the <img> tag.
It contains <area> elements which contains coordinates to make them clickable areas.
Syntax:
<map name=”mapid”> …</map>
Example
<map name="Maps"> <area shape ="poly" coords ="5,47,45,12,105,7,140,60,120,300,12,90" href ="http://www.thrillophilia.com/blog/beautiful-places-in-india/" target="_blank" alt="india places"> <area shape ="circle" coords ="154,150,59" href ="https://www.tripadvisor.in/HotelsList-India-Luxury-Resorts-zfp7790667.html" target="_blank" alt="india resorts"> </map>
Default CSS Value
display: inline;
How Browser will display
INLINE.
Difference between HTML4.01, XHTML and HTML5
HTML4 | XHTML | HTML5 |
---|---|---|
NA | name attribute is deprecated | new sizes attribute is added. The id attribute must hae the same value as the name attribute. |
Attributes used with <map> tag
Attribute | Description |
---|---|
name | To set the name of the map element. This is mandatory attribute. |
id | To set the id of the map. This is optional attribute. |
Note/Info The name of the map has name attribute as name="map-name". This attribute is coded on the <map> element and it is normally linked to the usemap attribute of the <img> element using the same map name.
Global Attributes
The <map>
Event Attributes
The <map>
Supporting Browsers
Related Tags
<img> & <area> tags.