HTML <map> nameAttribute

HTML map 标签参考手册HTML <map> Tag

Example

An image map with clickable areas:

<img src="planets.gif.html" width="145" height="126" alt="Planets" usemap="#planetmap">

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" href="sun.htm.html" alt="Sun">
  <area shape="circle" coords="90,58,3" href="mercur.htm.html" alt="Mercury">
  <area shape="circle" coords="124,58,8" href="venus.htm.html" alt="Venus">
</map>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute.


Definition and Usage

The name attribute is required and specifies the name of the image map.

The name attribute is associated with the usemap attribute of the <img> tag to create a relationship between the image and the map.


Differences between HTML 4.01 and HTML5

None.


Syntax

<map name="mapname">

Attribute Values

Value Description
mapname The name of the image map.


HTML map 标签参考手册HTML <map> Tag Other extensions