map

The HTML <map> element groups clickable regions for an image map. It connects an <img> to one or more <area> links.

What you will learn

Basic example

<img src="campus.png" alt="Campus map" usemap="#campus-map">
<map name="campus-map">
  <area shape="rect" coords="0,0,120,80"
        href="library.html" alt="Library">
  <area shape="circle" coords="220,60,35"
        href="cafe.html" alt="Cafe">
</map>

The value in usemap begins with # and must match the map’s name. Each area then defines a shape, coordinates, destination, and alternative label.

map groups; area does the linking

map is the container for the regions. It does not define clickable behavior by itself. The area elements inside it create the individual links.

Accessibility and alternatives

Common mistakes

Related pages