map – image map
<map name="name"><area …></map>
An image map: areas in an image, each of which leads somewhere else – regions on a map, rooms in a floor plan. The areas are written as area elements; the image is connected to the map with the usemap="#name" attribute.
- Default display:
display: inline - End tag: required
- Content:
areaelements and content its parent may contain - Where it can be used: anywhere phrasing content is allowed
- DOM interface:
HTMLMapElement
Attributes
- name (required) – the name of the map that
usemaponimgrefers to.
Examples
An image with two clickable areas:
<img src="/img/slider.jpg" alt="A castle with towers" width="500" height="333" usemap="#castle"> <map name="castle"> <area shape="rect" coords="120,60,220,210" href="#church" alt="Church towers"> <area shape="rect" coords="215,135,450,215" href="#castle-wing" alt="Castle wing"> </map>
Things to watch out for
- The coordinates are in pixels of the original image and are not recalculated when CSS scales the image down – on a responsive page the areas stop matching. More reliable is SVG with links or an image with links positioned with CSS.
- The areas are invisible – the user does not know where to click. Add the same links as text too.
Browser support
Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 1. As of October 2026 (MDN browser-compat-data).
Related:
area – image map area
img – image
svg – vector graphics
a – link