Tutorial 12: Embed with HTML - Page 8 - HTML with Style

Tutorial 12: Embed with HTML - Page 8

The first area is a circle. The first two co-ordinates specify the
center of the circle, and the third is the radius of the circle. The
second area is a rectangle. The first two co-ordinates specify the top
left corner of the rectangle, and the other two co-ordinates specify
the bottom right corner. The third area is a polygon. Every two
co-ordinates specify a point that makes up the polygon. The fourth
area is the default area, that is, any part of the image that isn't
part of another area.

Notice that all of the AREA elements have ALT
attributes. Hence, a user agent that can't handle images can offer the
different areas as a menu, using the alternate text to describe the
options.

What about user agents that can't understand client-side image maps
at all? The HTML 4.0 specification recommends putting some content
inside the MAP element for those browsers to render as an
alternative to the image map, but in practice both Internet Explorer
and Navigator will render this content even though they understand
image maps. The best you can do is to still use an A attribute
to make the image a hyperlink pointing to some default location. So
our image would be something like this:

<AHREF="./"><IMGSRC="example1.gif" USEMAP="#example"></A>

Now browsers that support image maps will ignore this link and use
the image map instead (as a matter of fact, if you haven't specified a
default area in your image map, they'll try this link instead when the
user clicks outside of the specified areas). But older browsers will
follow the link and presumably do something reasonable. If you're
completely paranoid, you can even give the element an ISMAP
attribute and make the hyperlink point to a server-side image
map. This way, if the user agent doesn't support client-side image
maps but does support server-side image maps, it will use the
server-side image map instead. You can accomplish this with a syntax
like the following: