The HTML <map>
element is used with <area>
elements to define an image map (a clickable link area).
Content categories | Flow content, phrasing content, palpable content. |
---|---|
Permitted content | Any transparent element. |
Tag omission | None, both the starting and ending tag are mandatory. |
Permitted parents | Any element that accepts phrasing content. |
Permitted ARIA roles | None |
DOM interface | HTMLMapElement |
This element includes the global attributes.
name
<map name="example-map-1"> <area shape="circle" coords="200,250,25" href="another.htm" /> <area shape="default" /> </map>
Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of '<map>' in that specification. | Living Standard | |
HTML5 The definition of '<map>' in that specification. | Recommendation | |
HTML 4.01 Specification The definition of '<map>' in that specification. | Recommendation | Initial definition |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 1.0 | (Yes) | 1.0 (1.7 or earlier)[1] 5.0 (5.0)[2] 17.0 (17.0)[3] | (Yes) | 1.0 | 1.0 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 1.0 | (Yes) | 1.0 (1.0)[1] 5.0 (5.0)[2] 17.0 (17.0)[3] | (Yes) | 1.0 | 1.0 |
[1] Starting in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), empty maps are no longer skipped over in favor of non-empty ones when matching when in quirks mode. For example, consider the following HTML:
<map></map> <map> <area shape="rect" coords="25,25,75,75" href="#fail"> </map> <img usemap="#a" src="image.png">
[2] Prior to Gecko 5.0, the <img>
element would have matched to the second, non-empty map. Now it matches against the first one, even though it's empty.
[3] From Firefox 17 the default styling of the <map>
HTML element is display: inline;
and no more display: block;
. This matches the behavior of the other browsers and was already the case in quirks mode.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map