HTML usemap Attribute
Example
<img src="demo/desk.jpg" usemap="#image-map">
<map name="image-map">
<area target="_blank" alt="Mobile" title="Mobil" href="demo/mobile.png" coords="174,432,285,626" shape="rect">
<area target="_blank" alt="computer" title="computer" href="demo/computer.png" coords="409,369,856,657" shape="rect">
<area target="_blank" alt="clock" title="clock" href="demo/clock.png" coords="1158,203,58" shape="circle">
</map>
Meaning
The usemap attribute contains the URL of the image map to be used with the object/image.
The URL is generally a fragment identifier that references a location in the current document rather than a remote resource(URL).
Standard Syntax
<element usemap="#mapname">
Browser Support
Status
Applies to:
The usemap attribute can be used on the following element:
Attribute Values
Value | Description |
---|---|
#mapname | The partial URL (starting with #) of an image <map>map associated with the element. |
More Examples
Example
<object usemap="#image-map" data="demo/image.jpg" width="300" height="150"></object>
<map name="image-map">
<area target="_blank" alt="Mobile" title="Mobil" href="demo/mobile.png" coords="174,432,285,626" shape="rect">
<area target="_blank" alt="computer" title="computer" href="demo/computer.png" coords="409,369,856,657" shape="rect">
<area target="_blank" alt="clock" title="clock" href="demo/clock.png" coords="1158,203,58" shape="circle">
</map>