The coords attribute on an <area> sets the pixel coordinates of a clickable hotspot in an image map. Pair it with shape (rect, circle, or poly). Values are CSS pixels from the image’s top-left corner.
shape="poly" reads an even-length list of numbers.
Three corners form a triangle pointing up from the bottom edge.
Closing is automatic if the first and last points differ.
Order of vertices follows the outline around the region.
Edge Cases & Pitfalls
Coords are measured on the image’s natural size — scaling and missing alt text cause common bugs.
scale
CSS resizing drifts hotspots
If you change the image’s displayed size with CSS, coords stay in the original pixel space. Prefer matching width/height attributes, or recalculate coords in script.
shape
Match shape and coords length
rect needs 4 numbers, circle needs 3, poly needs an even count of at least 6. Wrong length = broken or empty hotspot.
a11y
alt is required with href
Each linked area needs alt that describes the choice (like link text). Order areas in source to match visual reading order for keyboard users.
default
No coords on default
shape="default" is the leftover image region. Omit coords for that area.
JS
Update with area.coords
Assign a comma-separated string, e.g. area.coords = "64,64,40", when you need to move or resize a hotspot at runtime.
Compatibility
Browser Support
coords is an HTML attribute on <area> for image maps in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
coords
Widely available with HTML image maps. Support for rect, circle, and poly is consistent; test alignment when images are responsive.
98%Global support (approx.)
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetAll modern
Full support
Internet ExplorerAll versions
Supported
coordsWidely supported
Bottom line: Safe to use for classic image maps. Prefer SVG or CSS overlays when you need responsive, maintainable hotspots.
Remember
Key Takeaways
Role: pixel coordinates for an <area> hotspot.
Pairing: always match shape (rect / circle / poly).
Wiring:<map> + usemap on <img>.
Caution: omit coords for default; watch CSS scaling.
One line:coords draws the hotspot; shape chooses the geometry.
Frequently Asked Questions
On an area element inside a map, coords lists the hotspot’s CSS-pixel coordinates. The format depends on shape: rect uses four numbers, circle uses three, and poly uses pairs of x,y values.
Only area (inside map). The image links to the map with usemap. Do not put coords on img.
shape="rect" uses coords="x1,y1,x2,y2" — top-left and bottom-right corners in CSS pixels from the image’s top-left.
circle uses x,y,radius (center and radius). poly uses x1,y1,x2,y2,... for each vertex (at least three pairs). The browser closes the polygon if needed.
No. shape="default" covers the whole image (minus other areas). Omit coords in that case.
Image maps with coords are Baseline widely available and work in all modern browsers. Hotspots can misalign if the image is scaled with CSS without matching coordinates.