HTML and CSS Reference
In-Depth Information
We're sure you'll agree that the additional space around the image
makes the text easier to read and the overall page more attractive.
5.2.6.14. The ismap and usemap attributes
The
ismap
and
usemap
attributes for the
<img>
tag tell the browser that
the image is a special mouse-selectable visual map of one or more hy-
perlinks, commonly known as an
image map
. You can specify the
ismap
For example (notice the redundant attribute and value, as well as the
trailing end-tag slash mark in the
<img>
tag, which are telltale signs of
XHTML):
<a href="/cgi-bin/images/map2">
<img src="pics/map2.gif" ismap="ismap" />
</a>
The browser automatically sends the coordinates of the mouse relative
to the upper-left corner of the image to the server when the user clicks
somewhere on the
ismap
image. Special server software (the
/cgi-bin/
images/map2
program, in the example) may then use those coordinates
to determine a response.
The
ismap
attribute is a
server-side
mechanism because it relies on the
server for processing user input. The
usemap
attribute provides a
client-
side
image-map mechanism that effectively eliminates server-side pro-
cessing of the mouse coordinates and its incumbent network delays and
problems. Using special
<map>
and
<area>
tags, HTML authors provide a
map of coordinates for the hyperlink-sensitive regions in the
usemap
im-
age, along with related hyperlink URLs. The value of the
usemap
attribute
is a URL that points to that special
<map>
section. The browser on the
user's client computer translates the coordinates of a click of the mouse