Skip to content

<map> - The Image Map Element

Media Element HTML 2.0

The map element defines a client-side image map, allowing you to create clickable regions within an image. Each clickable area is defined using <area> elements, making parts of an image interactive without requiring separate image files.

Result
<img src="image.jpg" usemap="#mapname" alt="Description">
<map name="mapname">
<area shape="rect" coords="x1,y1,x2,y2" href="link.html" alt="Region 1">
<area shape="circle" coords="x,y,radius" href="link2.html" alt="Region 2">
</map>

Identifies the map so images can reference it:

Result

Link an image to a map using the usemap attribute:

<!-- Image references map -->
<img src="diagram.png" usemap="#diagram-map" alt="Diagram">
<!-- Map definition -->
<map name="diagram-map">
<area shape="rect" coords="10,10,100,100" href="#section1" alt="Section 1">
</map>

Multiple images can reference the same map:

Result

Maps contain <area> elements that define clickable regions:

Result

Define rectangular regions with top-left and bottom-right coordinates:

<!-- coords: x1,y1,x2,y2 -->
<area shape="rect" coords="10,10,200,100" href="link.html" alt="Rectangle">
Result

Define circular regions with center coordinates and radius:

<!-- coords: centerX,centerY,radius -->
<area shape="circle" coords="100,100,50" href="link.html" alt="Circle">
Result

Define irregular shapes with multiple coordinate pairs:

<!-- coords: x1,y1,x2,y2,x3,y3,... -->
<area shape="poly" coords="0,0,100,0,50,100" href="link.html" alt="Triangle">
Result

Catch-all region covering the entire image:

<area shape="default" href="fallback.html" alt="Default region">
Result
Result
Result
Result
Result

Every <area> must have descriptive alt text:

<map name="world-map">
<area shape="rect"
coords="0,0,200,100"
href="/europe"
alt="Navigate to Europe section">
<area shape="rect"
coords="200,0,400,100"
href="/asia"
alt="Navigate to Asia section">
</map>
Result

For complex image maps, provide a text-based alternative:

Result
Result
Result
// Get coordinates from image editor (Photoshop, GIMP, etc.)
// Or use browser DevTools to find pixel positions
FeatureChromeFirefoxSafariEdge
<map> element1+1+1+12+
name attribute1+1+1+12+
Rectangle shapes1+1+1+12+
Circle shapes1+1+1+12+
Polygon shapes1+1+1+12+
  1. Provide alt text for every <area> element
  2. Include text alternative for the entire map
  3. Keep regions large enough for touch targets (44x44px minimum)
  4. Test keyboard navigation with Tab and Enter
  5. Consider responsive alternatives like CSS Grid or SVG
  6. Use title attributes for hover tooltips
  7. Document coordinates for future maintenance
<!-- Coordinates don't scale on resize -->
<img src="image.jpg" usemap="#map" style="width: 100%;">
<!-- Small touch targets -->
<area shape="rect" coords="10,10,20,20" href="#link" alt="Tiny">
<!-- Missing alt text -->
<area shape="rect" coords="0,0,100,100" href="#link">
<!-- Wrong coordinate order -->
<area shape="rect" coords="200,200,10,10" href="#link" alt="Wrong">