HTML img usemap Attribute
HTML <img> tag
Definition and Usage
The usemap attribute specifies an image map to use on the
image.
This attribute refers to the id or name (browser dependant)
attribute in <map>.
To this attribute is used together with the <map>
and <area> elements.
Syntax
Syntax Example
<img usemap="#planetmap" />
|
Attribute Values
Value |
Description |
name/id |
Specifies the name or id (browser dependant) of the image
map to use |
Browser Support

The attribute is supported in all major browsers.
Example
Source |
Output |
<p>Click on one of the planets:</p>
<img src ="planets.gif" width="145" height="126"
alt="Planets" usemap="#planetmap" />
<map id ="planetmap" name="planetmap">
<area shape="rect" coords="0,0,82,126"
href="sun.htm" alt="Sun" />
<area shape="circle" coords="90,58,3"
href="mercur.htm" alt="Mercury" />
<area shape="circle" coords="124,58,8"
href="venus.htm" alt="Venus" /> </map>
|
Click on one of the planets:
|
Try-It-Yourself Demos
img usemap
attribute example
Specify the image map to use on the image.
HTML <img> tag
 |
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|