Media & Embedded Content

HTML <map> Tag

The <map> tag is used to define an image map. An image map is an image with clickable areas.

Definition and Usage

The <map> tag is used to define an image map. An image map is an image with clickable areas.

Standard Syntax:<map>...</map>

Interactive ExampleRunnable

HTML <map> Example

html
Try it Yourself
Live code demonstration for the <map> tag. Click "Try it Yourself" to edit and experiment in real time.
<div style="font-family: system-ui, sans-serif; padding: 16px; background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; color: #0f172a;">
<img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400" 
    height="379">

<map name="workmap">
  <area shape="rect" 
    coords="34,44,270,350" alt="Computer" href="computer.htm">
  <area 
    shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
  
    <area shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm">

    </map>
</div>

Attributes for <map>

1 Supported Attributes
AttributeValuesDefaultDescription
namemapnamenoneRequired. Specifies the name of the image map
Global Attributes

The <map> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <map> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Media & Embedded Content

View All 123Tags →