<map> & <area> Tags in HTML

Quick facts

Category<map>: flow, phrasing, palpable content. <area>: flow, phrasing content
Content model<map>: transparent (usually just <area> elements). <area>: empty, it’s a void element
Tag omission<map>: neither tag can be omitted. <area>: void element, no end tag
Permitted parents<map>: any element that accepts phrasing content. <area>: must be inside a <map>
DOM interfacesHTMLMapElement, HTMLAreaElement

Syntax

<img src="plan.png" alt="Floor plan" usemap="#plan"> <map name="plan"> <area shape="rect" coords="0,0,100,80" href="/kitchen/" alt="Kitchen"> <area shape="circle" coords="200,60,40" href="/garden/" alt="Garden"> </map>

Live example

Edit the code below and watch the preview update instantly.

index.html
Preview

Attributes

<map>

AttributeDescription
nameRequired. The name an image’s usemap="#name" refers to

<area>

AttributeDescription
shaperect, circle, poly or default (the whole image)
coordsPixel coordinates: x1,y1,x2,y2 for rect, x,y,radius for circle, x1,y1,x2,y2,… for poly
hrefWhere the region links to
altText describing the link, required when there is an href
target / download / relWork the same as on an <a> link

Common examples

A clickable floor plan

Each <area> is a link with a shape, coordinates and alt text.

<img src="floor-plan.png" alt="Office floor plan" usemap="#office" width="600" height="400"> <map name="office"> <area shape="rect" coords="0,0,300,200" href="/rooms/kitchen/" alt="Kitchen"> <area shape="rect" coords="300,0,600,200" href="/rooms/meeting/" alt="Meeting room"> </map>

Circles and polygons

Use circle (x, y, radius) for round spots and poly (a list of x,y points) for irregular shapes.

<area shape="circle" coords="120,90,40" href="/pins/park/" alt="City park"> <area shape="poly" coords="200,50,260,80,240,140,190,120" href="/regions/north/" alt="North district">

A text alternative under the image

Repeat the links as a normal list so everyone can reach them, including on small screens.

<ul class="map-links"> <li><a href="/rooms/kitchen/">Kitchen</a></li> <li><a href="/rooms/meeting/">Meeting room</a></li> </ul>

Image maps vs SVG links

Image map coordinates are in pixels, so they stop matching when the image is resized on a phone — unless you add JavaScript to rescale them. You also can’t style an <area> or show a hover effect.

An inline SVG solves both problems: shapes scale with the image, and each one can be wrapped in a link and styled with CSS hover and focus effects. For new interactive diagrams and maps, SVG is usually the better choice; image maps remain fine for quick, fixed-size images.

Image mapSVG with links
Scales with the imageNo (needs JS)Yes
Hover & focus stylesNoYes
EffortQuickMore setup

Common mistakes to avoid

  • Missing alt text on areas. Each <area> with an href needs alt, or screen reader users hear nothing useful.
  • Forgetting the # in usemap. It must be usemap="#name", matching <map name="name">.
  • Coordinates measured on the wrong size. Measure on the image at its real pixel size, not a scaled-down preview.
  • Using an image map on a responsive image. The clickable spots drift away from the picture when it shrinks.

Accessibility & SEO tips

  • Search engines follow <area href> links, but a plain text list of the same links is clearer for both visitors and crawlers.
  • Keep each clickable area big enough to tap with a finger — at least about 44 × 44 pixels.
  • Image maps give no visual hint that spots are clickable, so add labels or numbers on the image itself.

Browser support

Supported in every browser, including Chrome, Edge, Firefox, Safari and their mobile versions — it has been part of HTML since the very first versions.

Related tags

Frequently asked questions

Do image maps work on responsive images?
Not by themselves: the coords are fixed pixels, so they no longer line up when the image is resized. For responsive clickable images, use an inline SVG with <a> links around its shapes, or a small JavaScript library that rescales the coordinates.
Are image maps accessible?
They can be, if every <area> has meaningful alt text describing where it goes. Screen readers then list the areas like ordinary links.
Which area wins when two shapes overlap?
The one that comes first in the HTML. That's why the circle in the example is listed before the two halves.
How do I find the coordinates for an image map?
Open the image in an image editor and read the pixel positions of the corners, or use a free online image-map generator that lets you draw the shapes.
Can an <area> open a link in a new tab?
Yes. Area supports the same link attributes as <a>, including target="_blank", download and rel.
Can I highlight an area on hover?
Not with CSS — areas can't be styled. Use a JavaScript library, or build the map with SVG, where each shape can have hover and focus styles.