English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML map name attribute

The required name attribute specifies the name of the image map and is associated with the usemap attribute of <img>, creating a relationship between the image and the map.

 HTML <map> tag

Online example

Image map with clickable areas:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<map> name attribute - 基础教程网(oldtoolbag.com)</title>
</head>
<body>
<p>Click on the sun or on one of the planets to watch it closer:</p>
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.html">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.html">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.html">
</map>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the name attribute.

Definition and Usage

The name attribute specifies the name of the image map.

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

HTML 4.01 and HTML5differences between

None.

Syntax

<map name="mapname">

Attribute value

ValueDescription
mapnameName of the image map.
 HTML <map> tag