Last Updated on April 26, 2023 by Roshan Parihar
HTML map tag is used to give each image area a link to open on click.
Each area contains a link and you can open the link by clicking on that particular area. A mapping can be done by using <map> tag. This uses the image for mapping.
The name attribute of map tag and the usemap attribute of image tag with map name with # is used to make the relationship between image and mapping.
1 2 3 4 5 6 |
<img src="../images/nature.jpg" alt="nature image html map" usemap="#mymap"/> <map name="mymap"> <area shape="rect" coords="0,0,82,126" alt="paragraph" href="html-paragraph-tag"> <area shape="circle" coords="0,90,58,3" alt="list" href="html-list-tag"> <area shape="circle" coords="20,124,58,8" alt="image" href="html-image-tag"> </map> |
Output
Attribute of HTML map tag
Sr. No. | Attribute Name | Description |
---|---|---|
1 | name | This defines the name of the image map.
|
Resources and References
1. W3C Specification.
2. HTML living standard
3. W3C project using Github