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

NameTypeDescription
alttextRequired when href is present, except for narrowly defined alternatives; describes the link purpose.
coordscomma-separated integersDefines 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.
shapeenumerated: default, rect, circle, polySelects the geometry of an image-map area. The coords list must match the geometry; default covers the remaining image region.
hrefURLSpecifies 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.
targetbrowsing context name or reserved keywordSelects where a link or form opens. _self uses the current context; _blank requests a new context. Use appropriate opener isolation when opening external pages.
downloadoptional suggested filenameRequests download rather than navigation for an eligible link. Browsers may restrict cross-origin downloads and can adjust the suggested filename.
pingspace-separated HTTP(S) URLsLists 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.
relspace-separated relationship keywordsDefines relationships between a document and a linked resource or navigation target. Valid tokens depend on the element; stylesheet, noopener and canonical have different purposes.
referrerpolicyreferrer policy keywordControls 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>
HTML Reference