Latest web development tutorials

HTML img usemap property

HTML img tag Reference Manual HTML <img> tag

Examples

A clickable image map area with:

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

<map 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>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support usemap property.


Definition and Usage

usemap attribute the image is defined as client-side image maps (maps image refers to an image with clickable areas).

usemap attribute <map> name or id attribute associated elements in order to establish relations <img> and <map> between.

Note: Only when the descendants of <img> element does not belong <a> or <button> element is allowed only usemap property.


Differences between HTML 4.01 and HTML5

no.


grammar

<img usemap="#mapname">

Property Value

描述
#mapname 一个 hash 字符 ("#") 加上要使用的 <map> 元素的 name 或 id。


HTML img tag Reference Manual HTML <img> tag