CKTIS / HTML
usemap — associate an image with an image map
The usemap attribute on img references a client-side image map. Its area elements define which parts of the image link to particular destinations.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<img src="image.svg" usemap="#navigation" alt="Navigation">
<map name="navigation">…</map>usemap associates an img element with a map. Its area elements define links on the image. By contrast, ismap indicates a server-side image map.
The value takes the form #navigation: after #, it must exactly match the map's name in the same tree. An id alone is not conforming, although the parser can recognize it. If the map also has an id, it must equal name.
Give the image descriptive alt text and linked areas destination-oriented alt text. The coords coordinates use CSS pixels relative to the displayed image; check hotspot alignment after resizing it.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>usemap demo</title>
<img width="200" height="100" alt="Blue navigation panel"
usemap="#navigation"
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'%3E%3Cpath fill='royalblue' d='M0 0h200v100H0z'/%3E%3C/svg%3E">
<map name="navigation">
<area shape="rect" coords="0,0,200,100" href="#destination"
alt="Go to destination">
</map>
<p id="destination">Destination</p>
</html>Result
A blue 200 × 100 image and the text Destination. Clicking the image navigates to #destination.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.