HTML <map> Tag

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 3 Examples
Interactive Images

What You’ll Learn

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>.

01

Core Syntax

Pair img usemap with a named map.

02

name Attribute

Link image and map with matching names.

03

area Hotspots

Define clickable regions inside map.

04

Shape Types

Use rect, circle, and poly areas.

05

Navigation Maps

Build interactive diagram navigation.

06

Accessibility

Add alt text and text alternatives.

What Is the <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.

💡
Container for area elements

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.

📝 Syntax

Link an image to a map with usemap, then define hotspots inside <map>:

syntax.html
<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>

Syntax Rules

  • usemap on img must start with # followed by the map name or id.
  • <map> requires a name attribute (or id in HTML5).
  • Each hotspot is an <area> void element inside <map>.
  • Place <map> anywhere in the document — it does not wrap the image.

⚡ Quick Reference

Element / AttributeCode SnippetPurpose
Link image to mapusemap="#map-name" on imgActivate hotspots
Map container<map name="map-name">Groups area elements
Rectangleshape="rect" coords="x1,y1,x2,y2"Rectangular hotspot
Circleshape="circle" coords="x,y,r"Circular hotspot
Polygonshape="poly" coords="x1,y1,x2,y2,..."Custom shape
Default shapeshape="default"Entire image (rare)

⚖️ <map> vs <area>

ElementRoleKey attributes
<map>Container for all hotspotsname, id
<area>One clickable regionshape, coords, href, alt
<img>Displays the imagesrc, alt, usemap
TogetherComplete image mapimg + map + area(s)

See the HTML <area> tag tutorial for detailed hotspot attribute reference.

⚖️ HTML Image Map vs SVG Hotspots

ApproachBest forNotes
map + areaRaster images (PNG, JPG, WebP)No JavaScript required
SVG <a> elementsScalable vector graphicsResponsive, DOM-accessible
Responsive mapsMultiple img sizesNeeds coordinate scaling or SVG

🧰 Attributes

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 HTML5

Alternative to name in HTML5. Reference with usemap="#id".

id="site-map"
area shape On child

rect, circle, poly, or default on each <area>.

shape="rect"
area coords On child

Pixel coordinates matching the image dimensions and shape type.

coords="0,0,100,100"
area href On child

Destination URL when the hotspot is clicked.

href="/page"
area alt A11y

Descriptive text for each hotspot — required for accessibility.

alt="Home page"

* Either name or id must match the usemap fragment on the image.

Examples Gallery

Single hotspot, multi-region navigation, and circle-shaped areas on image maps.

Live Preview

Click a region on this interactive image map:

HTML and CSS navigation map — click a labeled regionLearn HTMLLearn CSS

Click the HTML or CSS region on the image.

Basic Image Map

One map with a single rectangular area linked to an image.

basic-map.html
<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>

📚 Common Use Cases

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.

Image Navigation

Multiple area elements inside one map for multi-page navigation.

navigation-map.html
<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>
Try It Yourself

Circle Hotspot

Use shape="circle" with coords="x,y,radius" for round clickable regions.

circle-map.html
<map name="product-map">
  <area shape="circle" coords="100,100,50" href="product.html" alt="Select product">
</map>

Styling Images with Image Maps

Style the associated <img> element. The <map> itself is not visible, but CSS on the image improves presentation:

max-width Responsive images
border-radius Rounded corners
outline Focus on area click
width/height Fixed coords reference
imagemap.css
img[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.

♿ Accessibility

Image maps require extra care for inclusive design:

  • alt on img — Describe the overall image for users who cannot see it.
  • alt on every area — Each hotspot needs descriptive alt text explaining where the link goes.
  • Text alternative — Provide a regular list of links below the image for keyboard-only users.
  • Meaningful coords — Test hotspots at actual image size so click targets are accurate.

🧠 How <map> Works

1

Author adds img + usemap

The image displays visually and references a map by name with usemap="#name".

Markup
2

map holds area definitions

Each <area> specifies shape, coords, and href for one region.

Hotspots
3

User clicks a region

Browser detects which area coords match the click and navigates to href.

Interaction
=

Interactive image navigation

One image becomes a clickable diagram linking to multiple destinations.

Universal Browser Support

The <map> element with <area> hotspots is fully supported in all modern browsers.

Baseline · Since HTML 3.2

Image maps that work everywhere

Client-side image maps with map and area are supported from legacy IE through the latest mobile browsers.

100% Core tag support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Client-side maps
Full support
Opera All modern versions
Full support
<map> tag 100% supported

Bottom line: Client-side image maps with <map> and <area> are safe to use in every production environment today.

Conclusion

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.

💡 Best Practices

✅ Do

  • Use usemap="#name" with matching map name
  • Add descriptive alt on every area
  • Test coords at the image’s display size
  • Provide text link alternatives below the image

❌ Don’t

  • Forget the # prefix in usemap
  • Leave area elements without alt text
  • Assume coords scale when the image is resized
  • Use image maps when simple text nav suffices

Key Takeaways

Knowledge Unlocked

Six truths every developer should know about <map>

Bookmark these before you build interactive image navigation.

6
Core concepts
🔗 02

usemap Link

img usemap="#name" activates the map.

Syntax
⚖️ 03

map vs area

map is container; area is each hotspot.

Comparison
04

Three Shapes

rect, circle, and poly coords.

Hotspots
05

alt Required

Every area needs descriptive alt text.

A11y
06

Universal Support

Works in all browsers including legacy IE.

Compatibility

❓ Frequently Asked Questions

It defines an image map container holding area elements that specify clickable regions on an associated image.
Add 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.
The # indicates a fragment identifier referencing the map’s name or id within the same document.
They can be, if every area has descriptive alt text and you provide a text-based navigation alternative.
Yes. Client-side image maps are fully supported in all modern and legacy browsers.

Practice Image Maps

Build clickable image navigation with map and area in the interactive editor.

Try It Yourself →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful