Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An HTML image map makes different regions of one image clickable links. Add a usemap attribute to the image, define a matching named map, then place an area element inside it for each hotspot. Each area needs a shape, coordinates, destination, and useful alternative text. The basic setup is straightforward; keeping hotspots aligned on a responsive image and making the links accessible takes a little more care.

Build a basic HTML image map

This example links three regions of a campus map to separate pages. Save the image as campus.jpg beside the HTML file, then adjust the coordinates to match the actual image.

<img src="campus.jpg"
     alt="Campus map showing the library, science hall, and student center"
     usemap="#campus-map">

<map name="campus-map" id="campus-map">
  <area shape="rect" coords="40,30,180,120"
        href="library.html" alt="Library">
  <area shape="circle" coords="280,95,45"
        href="science-hall.html" alt="Science Hall">
  <area shape="poly" coords="350,40,430,55,410,135,335,120"
        href="student-center.html" alt="Student Center">
</map>

The fragment in usemap="#campus-map" must match the name of the map. Keep that name unique in the document. The id is commonly included too, but it does not replace the matching name. The MDN reference for <map> describes the element and its relationship to the image.

Choose a shape and give it coordinates

  • rect: four numbers for the left, top, right, and bottom edges.
  • circle: center x, center y, then radius.
  • poly: successive x,y pairs tracing the boundary. The browser can close the polygon; you do not have to repeat its first point at the end.

Coordinates refer to the image’s intrinsic pixel grid, not necessarily the image’s current CSS width and height. For example, if the original image is 500 pixels wide but displayed at 250 CSS pixels, a hotspot at original x-coordinate 400 is still specified against the original grid. See MDN’s <area> reference for the area attributes and coordinate details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Measure and set hotspot coordinates

Use an image editor, a coordinate-reading tool, or a temporary overlay to identify the boundary of each clickable region. Record the points against the original image dimensions. For rectangles, note the upper-left and lower-right corners; for circles, note the center and radius; for polygons, record the boundary points in order.

  1. Check the image file’s natural width and height in its properties or in browser developer tools.
  2. Pick a hotspot whose boundary is easy to identify, and record coordinates from the image’s top-left corner.
  3. Enter those values in the matching coords format for the shape.
  4. Load the page and click inside and just outside each boundary. Adjust points that overlap a neighboring destination or leave an unintended gap.

Keep the actual image and its map together in the markup so their relationship is clear. If a page contains several mapped images, give every map a different name and make each image’s usemap point to the right one.

Make the map accessible and usable without hotspots

Provide alternative text for both the image and every linked area. W3C explains that the image’s alternative conveys its informative context, while each area’s alternative conveys the link destination or action. An area label such as alt="Library" is more useful than a description like “green rectangle.” See W3C WAI’s image-map guidance.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Write the image’s alt according to its purpose. If the image conveys information, describe that context. If it is decorative and the linked areas already provide the meaningful labels, use alt="" on the image rather than duplicating the area labels. Do not leave linked areas without their own alternatives.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Offer the same destinations as ordinary visible text links near the image. This fallback is useful to people using screen readers, keyboard navigation, touch interfaces, text-only browsing, or a browser in which the map is difficult to use. It also gives readers a clear way to reach each destination without having to discover the hotspot boundaries. W3C recommends client-side maps using usemap over server-side maps using ismap, because the server-side approach requires a specific input device; see W3C’s HTML Techniques for WCAG.

<ul>
  <li><a href="library.html">Library</a></li>
  <li><a href="science-hall.html">Science Hall</a></li>
  <li><a href="student-center.html">Student Center</a></li>
</ul>

Handle responsive image sizing

A common responsive style is img { max-width: 100%; height: auto; }. It lets the image shrink with its container, but the map’s pixel coordinates do not automatically become a new set of coordinates for every rendered size. As a result, a hotspot can stop lining up with its visual region on a narrow screen. MDN discusses this responsive limitation in its guide to adding a hitmap on top of an image, and W3C also warns that hotspots may fail on mobile if coordinates are not scaled in the same proportions as the image.

Choose an approach for a fluid layout

  • Keep an image map: test the map at each actual rendered image size in your design. If the implementation cannot keep coordinates aligned as the image scales, use a different pattern or prevent the image from resizing beyond the sizes you have checked.
  • Use an SVG overlay: when hotspots must scale with a fluid illustration, SVG can represent the image and clickable geometry in a shared scalable coordinate system.
  • Use positioned links: absolutely positioned links over an image can work for a small number of stable regions, but they also need responsive positioning rules and accessible labels.
  • Keep text links: a normal list remains useful whichever visual approach you choose, including as the reliable alternative when a hotspot cannot be reached or understood.

Test more than the desktop layout: check the narrowest and widest layouts the page supports, keyboard focus and activation, touch targets, and whether every visible region still leads to its intended destination. Do not assume that a map working at its original image size proves it will work after resizing.

Decide whether an image map is the right pattern

Use a map when the clickable geometry is central to understanding or using the image, such as selecting a room on a floor plan or a region on a labeled diagram. If users can choose from a simple set of destinations, ordinary text links are often easier to maintain and clearer to assistive technology. MDN notes that text links can be lighter to maintain and better supported by screen readers, text-only browsers, and translation services; its hitmap guide also discusses the trade-offs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Pattern Good fit Trade-off to consider
HTML image map Hotspots follow distinct regions in one image. Coordinates need careful authoring and can misalign when the image resizes.
SVG overlay Clickable shapes need to scale with a visual. Requires authoring and maintaining the SVG shapes and their links.
Ordinary text links Readers need a straightforward list of destinations. Does not make the corresponding regions within the image clickable.

Troubleshoot common problems

A hotspot does nothing when clicked

  • Check that the image’s usemap value begins with # and exactly matches a map’s name.
  • Check that the area has a valid href, the expected shape, and the right number and order of coordinates.
  • Confirm that the image is actually the image associated with that map, especially if the page has multiple maps.

The clickable region is shifted or too large

Coordinates may have been measured against a resized screenshot rather than the image’s intrinsic dimensions, or the image may be displayed at a different size. Recheck the original dimensions and test at the page’s rendered size. If the layout is fluid and the alignment cannot be maintained reliably, choose an SVG or positioned-link approach and retain text links as a fallback.

Assistive technology announces an unclear link

Add concise, destination-focused alt text to each linked area, and ensure the image’s own alt provides appropriate context or is empty when decorative. Include visible ordinary links to the same destinations so the choices are available outside the map.

Parts of the image cannot be reached on a phone

Check whether the image has scaled while its hotspots remained at their original coordinate positions. Test the actual mobile CSS size rather than only a desktop preview. If the geometry cannot stay aligned at supported sizes, replace the map with a scalable overlay or links and keep the text-link alternative.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a screenshot of the finished page to check how it renders, ScreenshotNeo can capture a URL with one GET request. This captures the page; it does not create the image map or verify that its hotspots work.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ScreenshotNeo API documentation

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/campus -o shot.webp

ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 shots. Every feature is on every plan.

Sign up for 1,000 free screenshots a month, with no card.

Frequently Asked Questions

Can one image map link to more than one page?

Yes. Add a separate linked <area> for each clickable region, with its own destination.

Does an image map work if JavaScript is disabled?

The basic client-side map uses HTML elements rather than JavaScript, so JavaScript is not required for the markup shown here.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
Web Design with HTML, CSS, JavaScript and jQuery Set
Web Design with HTML, CSS, JavaScript and jQuery Set
Brand: Wiley; Set of 2 Volumes
$35.05
SaleBestseller No. 2
HTML and CSS: Design and Build Websites
HTML and CSS: Design and Build Websites
HTML CSS Design and Build Web Sites; Comes with secure packaging; It can be a gift option
$14.94

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.