HTML <area> Tag

Beginner
6 min read
Updated: Oct 2026
5 examples
Live preview

Definition and Usage

The <area> element defines a clickable region (hotspot) inside an image map. It belongs inside a <map>, and the image links to that map with usemap.

Set the geometry with shape and coords, then link with href and describe the choice with alt (required when href is present).

Baseline · Widely available.

Core image-map support has been stable across browsers since about July 2015 (and much earlier in practice).

Obsolete attribute.

Do not use nohref. To make a non-link region, simply omit href.

Experimental.

interestfor (interest invokers) is newer and has limited support — skip it until you need that API.

HTML Syntax

syntax.html
<area shape=" rect" coords="x1,y1,x2,y2" href="url" alt="text">

<area> is a void element (start tag only). It must live under a <map> ancestor. Match usemap="#name" on the <img> to the map’s name.

Attributes

The attributes you will use most often on <area>:

AttributeDescriptionTry it
shapeHotspot shape: rect, circle, poly, or defaultTry it
coordsPixel coordinates for the shape (rect: x1,y1,x2,y2; circle: x,y,r; poly: x1,y1,…). Not used with defaultTry it
hrefLink destination. Omit it if the region should not be a hyperlinkTry it
altRequired when href is set — describes the link choice without the imageTry it
targetWhere to open the URL: _self, _blank, _parent, _topTry it
relLink relationship tokens when href is present (e.g. noopener)Try it
downloadHint to download the linked resource (same rules as on <a>)Same as <a>
referrerpolicyHow much referrer data to send when following the linkAdvanced
pingSpace-separated URLs that receive a PING POST when the link is followedSee edge cases

Global Attributes

The <area> tag also supports the Global Attributes in HTML.

Live Preview

Switch the hotspot shape on a real image map, then click the region.

Real <img usemap> + <area>. Apply a shape, then click the logo.

Image map
JavaScript logo image mapLearn JavaScript

shape="rect" coords="0,0,128,128"

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Basic Rectangular Hotspot

One rect area linked through usemap.

HTML
<img
  src="/images/javascript.png"
  alt="JavaScript logo"
  usemap="#js-map"
  width="128"
  height="128"
>
<map name="js-map">
  <area
    shape="rect"
    coords="0,0,128,128"
    href="/js/interview"
    alt="Learn JavaScript"
  >
</map>
Try It Yourself

How It Works

  1. Give the image a map. usemap="#js-map" points at a map name.
  2. Create <map name="js-map">. The name must match (without the #).
  3. Add <area>. shape="rect" with coords="x1,y1,x2,y2".
  4. Set href and alt. alt is required when the area is a link.

Example 2 — Circular Hotspot

Use shape="circle" with center x, y, and radius.

HTML
<img
  src="/images/javascript.png"
  alt="JavaScript logo"
  usemap="#circle-map"
  width="128"
  height="128"
>
<map name="circle-map">
  <area
    shape="circle"
    coords="64,64,60"
    href="/js/interview"
    alt="JavaScript — circular hotspot"
  >
</map>
Try It Yourself

How It Works

  1. Choose circle. Good for round logos and buttons on an image.
  2. Write coords="x,y,radius". Here 64,64 is the center of a 128×128 image.
  3. Keep radius inside the image so the hotspot does not spill past the edges.
  4. Still provide alt that names the destination.

Example 3 — Multiple Clickable Regions

One map can hold several areas for image-based navigation.

HTML
<img
  src="/images/area-example.png"
  alt="HTML and CSS navigation map"
  usemap="#nav-map"
  width="256"
  height="256"
>
<map name="nav-map">
  <area
    shape="rect"
    coords="111,1,253,98"
    href="https://codetofun.com/css"
    target="_blank"
    rel="noopener noreferrer"
    alt="Learn CSS (opens in new tab)"
  >
  <area
    shape="rect"
    coords="74,148,253,250"
    href="/html/tags/a"
    alt="Learn HTML"
  >
</map>
Try It Yourself

How It Works

  1. List areas in order. Earlier hotspots win when regions overlap.
  2. Give each region its own href and alt.
  3. Match image width/height to the size you used when measuring coords.
  4. Warn in alt when a region opens a new tab.

Example 4 — Polygon Hotspot

Use shape="poly" with a list of x,y pairs for irregular shapes.

HTML
<img
  src="/images/area-example.png"
  alt="Navigation map with polygon region"
  usemap="#poly-map"
  width="256"
  height="256"
>
<map name="poly-map">
  <area
    shape="poly"
    coords="50,50,200,50,125,200"
    href="/html/tags/a"
    alt="HTML Tags — triangular region"
  >
</map>
Try It Yourself

How It Works

  1. List vertices as x1,y1,x2,y2,…. At least three points are needed.
  2. Closing the shape: if the first and last pairs differ, the browser closes the polygon.
  3. Measure in image pixels (CSS pixels of the intrinsic image size).
  4. Prefer poly only when rect/circle cannot fit the region.

Example 5 — Open in a New Tab

Use target="_blank" with a clear rel and descriptive alt.

HTML
<img
  src="/images/area-example.png"
  alt="External link map"
  usemap="#blank-map"
  width="256"
  height="256"
>
<map name="blank-map">
  <area
    shape="rect"
    coords="111,1,253,98"
    href="https://codetofun.com"
    target="_blank"
    rel="noopener noreferrer"
    alt="Visit CodeToFun (opens in new tab)"
  >
  <area
    shape="rect"
    coords="74,148,253,250"
    href="/html/tags/a"
    alt="HTML anchor tag on this site"
  >
</map>
Try It Yourself

How It Works

  1. Set target="_blank" only when a new tab is intentional.
  2. Add rel="noopener noreferrer". Modern browsers also treat _blank as implicitly noopener.
  3. Say so in alt so assistive tech users are not surprised.
  4. Same rules as <a> for download, referrer, and tracking attributes.

Edge Cases & Pitfalls

Most image-map bugs come from wrong sizes, missing alt, or overlapping regions.

a11y

Always set alt on linked areas

With href, alt is required. Phrase it like a real link choice, not “click here”.

layout

Scaling breaks coords

If CSS resizes the image away from its coordinate system, hotspots drift. Keep matching width/height, or use <svg> for fluid UIs.

order

Overlaps: first match wins

Put specific regions before a catch-all shape="default" area.

name

usemap must match name

Use usemap="#my-map" with <map name="my-map">. A missing # or typo silently disables the map.

privacy

ping sends tracking POSTs

Support and user controls vary. Do not rely on it alone for analytics.

Browser Support

The <area> element is core HTML for image maps in every major browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<area>

Widely available since about July 2015 (and long before as HTML image maps). Chrome, Firefox, Safari, Edge, and Opera all support area, map, and usemap. Some extras such as ping vary.

97% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
<area> Widely supported

Bottom line: Safe for classic image maps. Treat responsive scaling carefully, and prefer SVG when hotspots must stay fluid.

Key Takeaways

  • Trio: <img usemap> + <map> + <area> create image maps.
  • Geometry: shape + coords define each hotspot in image pixels.
  • A11y: linked areas need meaningful alt text.
  • Responsive: scaled images can misalign coords — plan size or use SVG.

One line: a good <area> has clear shape/coords, a real href, and useful alt.

Default CSS Settings

<area> is not painted as a visible box. User agents typically hide it and attach hit-testing to the mapped image:

default.css
area {
  display: none;
}

You style the <img>, not the areas. Focus outlines for image-map links are browser-dependent — test keyboard access.

Frequently Asked Questions

The area element defines one clickable region (hotspot) inside an image map. Place area elements inside map, then link the image with usemap="#map-name".
Yes. area has a start tag only — no end tag and no child content. All behavior comes from attributes like shape, coords, href, and alt.
If the area has an href (it is a link), alt is required. Write alt so it offers the same choice the hotspot would if the image were unavailable.
rect (rectangle), circle, poly (polygon), and default (the rest of the image not covered by other areas). coords format depends on the shape.
coords use CSS pixels tied to the image’s intrinsic size. If CSS shrinks the image without matching width/height attributes (or recalculating coords), regions drift. Prefer fixed display size or SVG for fluid layouts.
Use area/map for a few hotspots on a raster image (PNG/JPG). Prefer SVG when you need many scalable, styleable interactive regions.

Next: article

Mark self-contained compositions like posts, news, and comments.

article tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful