Links & Navigation
HTML <area> element
Defines a region in an image map. For a linked region, provide appropriate alternative text and coordinates for its shape. The example uses illustrative local asset paths; supply matching files before running it. Use shape and coords together for geometric hotspots. A linked area must provide an appropriate text alternative. For complex images, also provide ordinary text links so navigation is not dependent on pointer coordinates. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<area shape="rect" coords="0,0,50,50" href="#item" alt="Item">Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| alt | text | Required when href is present, except for narrowly defined alternatives; describes the link purpose. |
| coords | comma-separated integers | Defines image-map hotspot coordinates according to shape: rectangle corners, circle center and radius, or polygon points. Coordinates are in CSS pixels relative to the image. |
| shape | enumerated: default, rect, circle, poly | Selects the geometry of an image-map area. The coords list must match the geometry; default covers the remaining image region. |
| href | URL | Specifies a link destination, resource URL or document base URL depending on the element. An anchor without href is not a normal navigable hyperlink. Relative URLs resolve against the document base URL. |
| target | browsing context name or reserved keyword | Selects where a link or form opens. _self uses the current context; _blank requests a new context. Use appropriate opener isolation when opening external pages. |
| download | optional suggested filename | Requests download rather than navigation for an eligible link. Browsers may restrict cross-origin downloads and can adjust the suggested filename. |
| ping | space-separated HTTP(S) URLs | Lists endpoints that can receive hyperlink-auditing POST requests when a link is followed. Privacy settings or browser behavior may restrict it. Do not rely on it for essential logic. |
| rel | space-separated relationship keywords | Defines relationships between a document and a linked resource or navigation target. Valid tokens depend on the element; stylesheet, noopener and canonical have different purposes. |
| referrerpolicy | referrer policy keyword | Controls the referrer information sent with an eligible fetch or navigation. no-referrer omits it; strict-origin-when-cross-origin is a common default policy. It does not prevent all tracking. |
Return Value
HTMLAreaElement
Content model: Empty; this void element cannot contain children and must not have an end tag. No closing tag.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <img src="plan.png" alt="Floor plan" usemap="#rooms" width="100" height="100"> <map name="rooms"> <area shape="rect" coords="0,0,50,50" href="#room" alt="Room A"> </map> <p id="room">Room A</p> </body></html>