<map>
ElementThe HTML <map>
element is used to define an image map, which is a clickable area on an image that links to another webpage or performs a specific action.
<img src="image.jpg" alt="Image with clickable areas" usemap="#mapname">
<map name="mapname">
<area shape="rect" coords="x1,y1,x2,y2" href="link1.html" alt="Link 1">
<area shape="circle" coords="x,y,radius" href="link2.html" alt="Link 2">
<area shape="poly" coords="x1,y1,x2,y2,x3,y3,...,xn,yn" href="link3.html" alt="Link 3">
</map>
name
: Specifies the name of the map.area
: Defines a clickable area within the image map.
shape
: Specifies the shape of the area (rect, circle, poly).coords
: Specifies the coordinates of the area (x1,y1,x2,y2 for rectangles, x,y,radius for circles, x1,y1,x2,y2,x3,y3,...,xn,yn for polygons).href
: Specifies the link URL for the area.alt
: Specifies the alternative text for the area.The HTML <map>
element is supported by all modern browsers, including Chrome, Firefox, Safari, Edge, and Internet Explorer.
alt
text for each area to improve accessibility.