HTML Reference ยท Images and Media
The <area> element
Reference for the HTML <area> element: shapes and coordinates for image map hotspots, alt text, link attributes, accessibility notes and technical details.
The <area> element defines one clickable region of an image map. It lives inside a <map>, which an <img> points to with its usemap attribute. Each area describes a shape on the image (a rectangle, a circle or a polygon) and, usually, a link that the region follows when it is clicked.
An <area> is never drawn on its own. The browser only uses its geometry to decide where clicks land and where keyboard focus goes.
<area shape="rect" coords="10,10,110,60" href="/tickets" alt="Buy tickets">
Try it
When regions overlap, the area that comes first in the source wins. That is why the sun is listed before the hills, which overlap its lower half.
Attributes
| Attribute | Values | Description |
|---|---|---|
alt |
Text | The text alternative for the region. Required whenever href is present; it is the link's accessible name. |
shape |
rect (default), circle, poly, default |
The kind of region. default covers the whole image and takes no coords. |
coords |
Comma-separated numbers | The geometry, in CSS pixels from the top-left corner of the image. rect: left,top,right,bottom. circle: x,y,radius. poly: x1,y1,x2,y2,โฆ (at least three points; the shape closes itself). |
href |
URL | The link target. Without href, the area is a dead region that is not focusable and not a link. |
target |
_self, _blank, _parent, _top or a frame name |
Where to open the link, as on <a>. |
download |
Empty or a file name | Download the linked resource instead of navigating to it. |
rel |
Space-separated link types | The relationship to the target, such as nofollow, noopener or noreferrer. |
referrerpolicy |
no-referrer, origin, strict-origin-when-cross-origin, โฆ |
How much referrer information to send when following the link. |
ping |
Space-separated URLs | URLs that receive a small POST request when the link is followed. |
It also accepts the global attributes. The old spellings circ, polygon and rectangle for shape still work in browsers but are non-conforming.
Usage notes
- Always write
alt. Screen readers announce each area as a link, usingaltas its name. Describe the destination ("Cafรฉ menu"), not the shape ("left rectangle"). - Coordinates don't scale. They are fixed pixel values, so the regions drift when CSS resizes the image. For responsive layouts, consider an inline
<svg>with real links instead. - Source order is focus order. Keyboard users move through areas in the order they appear in the map, so list them in a sensible reading order.
- Make regions findable. Nothing on the image shows that it is clickable. Add a visible hint, or offer the same links as a normal list next to the image.
- Areas without
href. An area with nohrefblocks clicks on that part of the image without going anywhere. Use it on purpose (for example to carve a hole in a larger region), not by accident.
Technical summary
| Content categories | Flow content, phrasing content |
| Permitted content | Nothing; it is a void element |
| Tag omission | Start tag required; must not have an end tag |
| Permitted parents | Any element that accepts phrasing content, as long as there is a <map> ancestor |
| Implicit ARIA role | link when href is present; otherwise generic |
| DOM interface | HTMLAreaElement |
| Default display | none (the region is defined by the image, not drawn) |
Browser support
Supported in every browser.
Related
<map>โ the container that groups the areas<img>โ the image that uses the map throughusemap<a>โ an ordinary hyperlink- Lesson: Image Maps
- Lesson: Images