Name

map — HTML 4.01 | HTML5

Synopsis

<map> . . . </map>

Specifies a client-side image map. It contains some number of area elements that establish clickable regions within the image map.

Notes

The map must be named using the name attribute in HTML documents, the id attribute in XHTML documents, or both for backward compatibility. When both are used, they must have the same value.

Start/End Tags

Required/Required

Attributes

Core, Internationalization, Events, HTML5 Global Attributes

id="text"

Required in XHTML. Gives the map a unique name so that it can be referenced from a link, script, or style sheet.

name="text"

Required in HTML 4.01 and 5; deprecated in XHTML 1.0 only; use id instead. Gives the image map a name that is then referenced within the img element.

Example

<map name="space" id="space">
  <area shape="rect" coords="203,23,285,106"
    href=http://www.nasa.gov alt="">
  <area shape="circle" coords="372,64,40"
    href="mypage.html" alt="">
</map>

Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.