Syntax
<img src="image.jpg" usemap="#map1">
<map name="map1">
<area shape="rect" coords="0,0,100,100" href="/page1">
</map>Examples
Rectangular Regions
A simple image map with rectangular clickable areas.
<img src="nav-diagram.png" usemap="#navmap" alt="Site navigation diagram">
<map name="navmap">
<area shape="rect" coords="0,0,150,50" href="/home" alt="Home">
<area shape="rect" coords="150,0,300,50" href="/about" alt="About">
</map>Circular Region
Defining a circular clickable area.
<img src="world-map.png" usemap="#continents" alt="World map">
<map name="continents">
<area shape="circle" coords="200,150,40" href="/europe" alt="Europe">
</map>Polygon Region
Defining a custom-shaped clickable area.
<map name="shapes">
<area shape="poly" coords="50,10,90,90,10,90" href="/triangle-info" alt="Triangle">
</map>Attributes
- name (string): Used on map; must match the img's usemap value
- usemap (string): Used on img; references a map by name, prefixed with #
- shape (rect | circle | poly | default): Used on area; the shape of the clickable region
- coords (string): Used on area; coordinates defining the region's boundaries
Best practices
- Always include alt text on each area for accessibility, same as a regular link
- Consider whether separate, individually styled elements (like a CSS grid of linked images) would be simpler than coordinate-based regions
- Image maps do not scale coordinates automatically with responsive images — test carefully on different screen sizes
- Keep coordinate math simple by using rect and circle shapes where possible rather than complex polygons
At a glance
- Purpose
- Structure and meaning for web content
- File extension
- .html · .htm
- Runs in
- Web browsers
- Usually used with
- CSS and JavaScript
Specifications & further reading
Related HTML documentation
<img>
The <img> element embeds images into web pages. Images enhance visual communication and user engagement. The src attribute specifies the image source, while alt provides alternative text for accessibility and SEO. Images are inline-replaced elements, meaning they display in the flow of text but are replaced with the actual image content.<figure>, <figcaption>
The <figure> element wraps self-contained content — typically an image, illustration, diagram, code snippet, or chart — along with an optional caption provided by <figcaption>. Content in a figure is meant to be referenceable independently of the main flow; a reader should be able to move it elsewhere on the page (or even to an appendix) without breaking the document's meaning.<video>
The <video> element embeds video content directly in a web page without needing a third-party plugin. It supports built-in playback controls, multiple source formats via nested <source> elements for browser compatibility, and various attributes for controlling autoplay, looping, and muting.<audio>
The <audio> element embeds sound content — music, podcasts, or sound effects — directly in a page. Like <video>, it supports multiple <source> elements for format fallback and built-in playback controls, without needing Flash or other plugins.
The <img> element embeds images into web pages. Images enhance visual communication and user engagement. The src attribute specifies the image source, while alt provides alternative text for accessibility and SEO. Images are inline-replaced elements, meaning they display in the flow of text but are replaced with the actual image content.<figure>, <figcaption>
The <figure> element wraps self-contained content — typically an image, illustration, diagram, code snippet, or chart — along with an optional caption provided by <figcaption>. Content in a figure is meant to be referenceable independently of the main flow; a reader should be able to move it elsewhere on the page (or even to an appendix) without breaking the document's meaning.<video>
The <video> element embeds video content directly in a web page without needing a third-party plugin. It supports built-in playback controls, multiple source formats via nested <source> elements for browser compatibility, and various attributes for controlling autoplay, looping, and muting.<audio>
The <audio> element embeds sound content — music, podcasts, or sound effects — directly in a page. Like <video>, it supports multiple <source> elements for format fallback and built-in playback controls, without needing Flash or other plugins.