Live Preview
Click a region on this interactive image map:

Click the HTML or CSS region on the image.

By the end of this tutorial, you’ll create image maps with <map>, link them to images via usemap, and define clickable hotspots with <area>.
Pair img usemap with a named map.
Link image and map with matching names.
Define clickable regions inside map.
Use rect, circle, and poly areas.
Build interactive diagram navigation.
Add alt text and text alternatives.
<map> Tag?The map element (<map>) defines an image map — a set of clickable hotspots on an image. It works together with the <img> usemap attribute and one or more <area> children that specify each region’s shape, coordinates, and link.
The <map> tag itself is not visible. It groups <area> definitions. The associated <img> displays the image and activates the hotspots when users click.
Image maps are useful for navigation diagrams, interactive infographics, and floor plans where different regions of a single image link to different pages.
Link an image to a map with usemap, then define hotspots inside <map>:
<img src="diagram.png" alt="Site diagram" usemap="#site-map">
<map name="site-map">
<area shape="rect" coords="0,0,100,100" href="/home" alt="Home">
<area shape="circle" coords="200,200,50" href="/about" alt="About">
</map>usemap on img must start with # followed by the map name or id.<map> requires a name attribute (or id in HTML5).<area> void element inside <map>.<map> anywhere in the document — it does not wrap the image.| Element / Attribute | Code Snippet | Purpose |
|---|---|---|
| Link image to map | usemap="#map-name" on img | Activate hotspots |
| Map container | <map name="map-name"> | Groups area elements |
| Rectangle | shape="rect" coords="x1,y1,x2,y2" | Rectangular hotspot |
| Circle | shape="circle" coords="x,y,r" | Circular hotspot |
| Polygon | shape="poly" coords="x1,y1,x2,y2,..." | Custom shape |
| Default shape | shape="default" | Entire image (rare) |
<map> vs <area>| Element | Role | Key attributes |
|---|---|---|
<map> | Container for all hotspots | name, id |
<area> | One clickable region | shape, coords, href, alt |
<img> | Displays the image | src, alt, usemap |
| Together | Complete image map | img + map + area(s) |
See the HTML <area> tag tutorial for detailed hotspot attribute reference.
| Approach | Best for | Notes |
|---|---|---|
map + area | Raster images (PNG, JPG, WebP) | No JavaScript required |
SVG <a> elements | Scalable vector graphics | Responsive, DOM-accessible |
| Responsive maps | Multiple img sizes | Needs coordinate scaling or SVG |
The <map> element uses name (or id) plus global attributes. Hotspot details live on child <area> elements:
name Required*Identifies the map so usemap="#name" on the image can reference it.
name="site-map"id HTML5Alternative to name in HTML5. Reference with usemap="#id".
id="site-map"area shape On childrect, circle, poly, or default on each <area>.
shape="rect"area coords On childPixel coordinates matching the image dimensions and shape type.
coords="0,0,100,100"area href On childDestination URL when the hotspot is clicked.
href="/page"area alt A11yDescriptive text for each hotspot — required for accessibility.
alt="Home page"* Either name or id must match the usemap fragment on the image.
Single hotspot, multi-region navigation, and circle-shaped areas on image maps.
Click a region on this interactive image map:

Click the HTML or CSS region on the image.
One map with a single rectangular area linked to an image.
<img src="logo.png" alt="Logo" usemap="#image-map">
<map name="image-map">
<area shape="rect" coords="0,0,128,128" href="/home" alt="Home">
</map>Use <map> for site navigation diagrams, interactive infographics, product selector images, floor plans, anatomical charts, and any raster image where different regions link to different pages.
Multiple area elements inside one map for multi-page navigation.
<img src="site-map.jpg" alt="Site map" usemap="#site-map">
<map name="site-map">
<area shape="rect" coords="50,50,150,150" href="home.html" alt="Home">
<area shape="rect" coords="200,50,300,150" href="about.html" alt="About">
</map>Use shape="circle" with coords="x,y,radius" for round clickable regions.
<map name="product-map">
<area shape="circle" coords="100,100,50" href="product.html" alt="Select product">
</map>Style the associated <img> element. The <map> itself is not visible, but CSS on the image improves presentation:
max-width Responsive imagesborder-radius Rounded cornersoutline Focus on area clickwidth/height Fixed coords referenceimg[usemap] {
max-width: 100%;
height: auto;
border-radius: 8px;
border: 1px solid #e2e8f0;
cursor: pointer;
}
/* Coords are pixel-based — keep img dimensions consistent */
img.imagemap-fixed {
width: 256px;
height: 256px;
}Styled image map preview

Image map coordinates are pixel values relative to the image’s intrinsic dimensions. Scaling the image with CSS does not automatically rescale coords.
Image maps require extra care for inclusive design:
The image displays visually and references a map by name with usemap="#name".
Each <area> specifies shape, coords, and href for one region.
Browser detects which area coords match the click and navigates to href.
One image becomes a clickable diagram linking to multiple destinations.
The <map> element with <area> hotspots is fully supported in all modern browsers.
Client-side image maps with map and area are supported from legacy IE through the latest mobile browsers.
Bottom line: Client-side image maps with <map> and <area> are safe to use in every production environment today.
The <map> tag turns static images into interactive navigation diagrams. Combined with <img usemap> and <area> hotspots, it provides a native HTML way to link different image regions to different pages.
Always match map name to usemap, add descriptive alt text on every area, and provide a text-based link list for accessibility.
usemap="#name" with matching map namealt on every area# prefix in usemaparea elements without alt text<map>Bookmark these before you build interactive image navigation.
<map> groups hotspot definitions.
img usemap="#name" activates the map.
map is container; area is each hotspot.
Comparisonrect, circle, and poly coords.
HotspotsEvery area needs descriptive alt text.
A11yWorks in all browsers including legacy IE.
Compatibilityarea elements that specify clickable regions on an associated image.usemap="#map-name" to the img and set name="map-name" on the map element.map is the container. Each area inside it defines one clickable hotspot with shape, coords, and href.# indicates a fragment identifier referencing the map’s name or id within the same document.area has descriptive alt text and you provide a text-based navigation alternative.Build clickable image navigation with map and area in the interactive editor.
6 people found this page helpful