docs.rodeo

MDN Web Docs mirror

: The Image Map element

{{HTMLSidebar}} 

The <map> HTML element is used with {{HTMLElement("area")}}  elements to define an image map (a clickable link area).

{{EmbedInteractiveExample("pages/tabbed/map.html", "tabbed-standard")}} 

Attributes

This element includes the global attributes.

Examples

Image map with two areas

Click the left-hand parrot for JavaScript, or the right-hand parrot for CSS.

HTML

<!-- Photo by Juliana e Mariana Amorim on Unsplash -->
<map name="primary">
  <area
    shape="circle"
    coords="75,75,75"
    href="https://developer.mozilla.org/docs/Web/JavaScript"
    target="_blank"
    alt="JavaScript" />
  <area
    shape="circle"
    coords="275,75,75"
    href="https://developer.mozilla.org/docs/Web/CSS"
    target="_blank"
    alt="CSS" />
</map>
<img
  usemap="#primary"
  src="parrots.jpg"
  alt="350 x 150 picture of two parrots" />

Result

{{ EmbedLiveSample('Image map with two areas', '', '250') }} 

Technical summary

Content categories Flow content, phrasing content, palpable content.
Permitted content Any transparent element.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts phrasing content.
Implicit ARIA role No corresponding role
Permitted ARIA roles No role permitted
DOM interface `{{domxref("HTMLMapElement")}}` 

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN