| Depr. | Version |
|---|---|
| No | HTML 4 |
| IE8+ | FF1+ | SA4 | OP10 | CH2 |
|---|---|---|---|---|
| Full | Full | None | None | None |
Syntax
Description
The
usemap attribute tells the browser which of the
map elements in the document it
should refer to. The hotspots defined (using the area element) act as overlays on the object.
These areas are similar to links (created with the a element), and allow the user to click to
go to the page identified in the respective area’s
href attribute. They’re also
keyboard-navigable.
The usemap
attribute is only used in the object element when the
type of object is an image (.gif,
.jpg, or
.png).
Example
This
usemap attribute references a map named
"dogmap":
<p>
<object data="giant-dog.jpg" usemap="#dogmap"
height="225" width="300" border="0"></object>
<map name="dogmap" id="dogmap">
<area shape="circle" coords="216,120,24"
href="http://tirauinfo.homestead.com/TheBigDog.html"
alt="Click on the nose for more info about this big dog!"/>
</map>
</p>
Value
This attribute takes as
its value a reference to the map’s name attribute
in form of an "#" character plus the
"name", like so:
usemap="#dogmap"
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| None | None | None | Full | Full | Full | Full | Full | Full | None | None | None | None | None | None | None | None |
Very poor support for this attribute. Assuming that the browser
is capable of rendering the content defined in the
object tag in the first place (IE 7 and earlier, we’re
looking at you), getting the usemap attribute to to
work is a fruitless task, at least in any browser other than Firefox.
However, the usemap attribute
works perfectly well when used with the img element, so if an image map is what you need, take that approach
instead.
User-contributed notes
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.




