0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Defines a clickable region within a map element using pixel-based shape coordinates. Used with img and map for client-side image maps.
Description
The <area> element defines a single clickable region inside an image map. It is always a child of a <map> element. Each area specifies a shape, pixel-based coords, and a destination href.
The <area> element is a void element — it has no closing tag and cannot contain child content. Tooltip text is limited to the titleattribute (plain text only).
Live Demo
Hover over a room to see its title tooltip. Click to see the area name. The image is kept at its 800×500 pixel size (the demo scrolls sideways if the window is narrower) so the pixel-based coordinates line up with the drawing.
Complete image map with all shape types
12345678910111213141516171819
<imgsrc="floor-plan.jpg"alt="Office floor plan"usemap="#office"width="800"height="500" /><mapname="office"><areashape="rect"coords="40,40,320,220"href="/rooms/conference"alt="Conference Hall"title="Conference Hall — seats 120" /><areashape="circle"coords="500,160,80"href="/rooms/server"alt="Server Room"target="_blank" /><areashape="poly"coords="480,280,760,280,760,460,560,460,480,380"href="/rooms/office"alt="Open Office" /><areashape="default"href="/rooms"alt="View all rooms" /></map>
Shape Types
The shapeattribute determines how coords are interpreted. All coordinate values are CSS pixels measured from the top-left corner of the rendered image. They do not scale: if the image is drawn at a different size from the one the coordinates were written for, the regions stay put and stop matching the picture.
Overlapping areas
Areas are hit-tested in document order. Where two areas overlap, the first one in the <map> wins. Put smaller, more specific regions before larger ones, and always put shape="default" last — placed first, it would capture every click.
Rectangle
Defined by the top-left and bottom-right corners: left, top, right, bottom.
Covers the whole image. Because earlier areas win, it only receives clicks that no other area claims — so it must be the last <area> in the map. Useful as a catch-all link.
Default area
1234
<areashape="default"href="/rooms/overview"alt="View building overview" /><!-- Covers the entire image not matched by other areas -->
Triggers a download instead of navigation. Value suggests the filename. Only honoured for same-origin URLs (and blob:/data:); cross-origin links navigate normally.
How much referrer information to send when following the area (no-referrer, origin, strict-origin-when-cross-origin, etc.)
title
string
No
Tooltip text shown on hover. Plain text only.
The Responsive Problem
The <area> coordinate system uses fixed CSS pixel values measured from the top-left of the rendered image. When the image scales responsively (as it does in every modern layout), the clickable regions no longer align with the visual regions.
For example, an area defined at coords="40,40,320,220" targets pixels 40–320 horizontally. If the image renders at half width (400px instead of 800px), the area still covers pixels 40–320 of the rendered image — now most of its width — so clicks land on the wrong room.
Every <area> with an hrefmust have an altattribute
Screen readers announce alt text as the link label
Users navigate between areas with Tab
Browsers draw the focus ring around the area’s shape. VB styles it with :focus-visible in the theme’s interactive colour; on a busy image it can still be hard to see, so keep hotspots on calm regions or add visible labels.
The titleattribute provides hover tooltips but is not reliably announced by screen readers — do not use it as the sole accessible name
Related
<map> — container element that groups <area> elements