The <map> element defines an image map — named clickable regions used with <area> and an <img> that points to the map with usemap.
Give the map a required name (no spaces, unique in the document). On the image, set usemap="#that-name". Each hotspot needs shape, coords, href, and a clear alt.
Baseline · Widely available.
Not deprecated. Stable across modern browsers since about July 2015.
Responsive pitfall.
Area coordinates are tied to the image’s intrinsic size. CSS scaling often misaligns hotspots — keep displayed size equal to the coord system, or use another pattern for fluid layouts.
Add one area per hotspot with its own coords and href.
Give every area an alt that names that destination.
Order matters for overlaps — earlier areas typically win when regions overlap.
Edge Cases & Pitfalls
Most map bugs are name mismatches, missing #, bad coords, or responsive scaling.
name
usemap must include #
Write usemap="#plan" and name="plan". Omitting # breaks the link.
unique
Duplicate map names
name must be unique and non-empty, with no space characters. If you set id, it must equal name.
responsive
CSS-scaled images break hit areas
Coords do not auto-scale with width: 100%. Prefer fixed size or overlay links / SVG for fluid UIs.
a11y
Missing alt on areas
Each linked region needs an accessible name. Also keep a meaningful alt on the img.
coords
Wrong coordinate units
rect is x1,y1,x2,y2; circle is cx,cy,r; poly is a list of x,y pairs.
Compatibility
Browser Support
The <map> element is core HTML in every browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<map>
Widely available since about July 2015. Pair with area and img usemap everywhere.
98%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerAll
Supported
<map>Widely supported
Bottom line: Safe for classic image maps. Watch coordinate alignment when images resize.
Remember
Key Takeaways
Trio:img[usemap] + map[name] + area hotspots.
name: required, unique, no spaces; usemap="#name".
Areas: set shape, coords, href, and alt.
Scaling: avoid CSS-only resize that desyncs hit areas.
One line:usemap="#name" + <map name="name"> + labeled <area>s.
UA style
Default CSS Settings
<map> itself does not draw a box; hotspots are hit-testing regions on the image:
default.css
map {
display: inline; /* typical — no visible chrome of its own */
}
/* The linked image still uses normal replaced-element rules */
img {
/* display / sizing from the UA and your layout */
}
Style the img for layout; do not expect borders or backgrounds on map to outline the areas.
Frequently Asked Questions
The map element defines an image map — a set of clickable regions — used together with area elements and an img that references the map via usemap.
On the img, set usemap="#name" where name matches the map’s name attribute (include the #). The name must be unique in the document and contain no spaces.
One or more area elements that set shape, coords, href, and alt for each hotspot.
If you set both name and id on the same map, they must have the same value.
Hotspot coordinates are based on the image’s intrinsic size. Scaling the image with CSS often misaligns areas — prefer fixed display size or another UI pattern for fluid layouts.
Yes. Each area that is a link needs an alt that describes the destination or purpose, similar to a text link.