This element is used inside a map element to define the various areas that a user can select and the action that occurs when the area is selected. This is used in client-side maps (that means all the work is done by the browser on the viewers computer.
<html> <head> <title>A Map Page</title> </head> <body> . . <map name="buttonmap"> ==>> <area href=button1.html alt="button1" shape=rect coords="0,0,100,50"> ==>> <area href=button2.html alt="button2" shape=rect coords="100,0,200,50"> ==>> <area href=button3.html alt="button3" shape=rect coords="0,50,100,100"> ==>> <area href=button4.html alt="button4" shape=rect coords="100,50,200,100"> </map> . . </body> </html>
Now this assumes that somewhere on the page I've got a corresponding img that has a usemap attribute that matches the name in the map element. It also assumes that this image is at least 200 pixels wide by 100 pixels high. Now, if all that's true then we're in business to use it as a map for the viewer to select places to go. I didn't get very fancy, I just used a rectangular image divided evenly into four pieces.
The coordinates get a little confusing so I'll go into a lot of detail to try to make it clearer. My picture could look like the following:
x=0,y=0
x=100,y=0
x=200,y=0
+-------------------------------------------------------------------------+
|
Button 1
|
Button 2
|
+------------------------------------|-------------------------------------+
x=200,y=50
|
Button 3
|
Button 4
|
+-------------------------------------------------------------------------+
x=0,y=100
x=100,y=100
x=200,y=100
When you are entering the coordinates for a rectangular area, you use the top left corner and the bottom right corner to define the area. The numbers always go as the x and y values for each of these positions. In the picture above, the top left corner for Button 1 is at x=0 and y=0. The bottom right corner is at x=100 and y=50. Clear? Good, I thought this would make it easier for you to visualize!
To complicate matters, you can use a circular shape where you define the center point using the x and y coordinates then specify a radius length in pixels. I won't try to draw a picture of that one. Just use your imagination to think it through.
And, just in case that wasn't enough flexibility for you, there's a poly shape where you just specify the different corners with x and y values.
Shapes can overlap! That's a scary thought for the careless artist! Browsers are supposed to honor the areas in the order they are defined in the map. Kind of first come, first served as it were.
Besides having the shapes link to something else, you can specify that an area is a "do nothing" area, too. I'm sure you can think of something that would require that kind of option.
This element takes the following attributes:
Nothing special.
Nothing special.
Nothing special.
The Rusk Family . . . "the Legend
Continues"
All contents copyright © 1996, 1997 Michael T. Rusk
All rights reserved.
Revised: December 03, 1997 10:35 -0500
URL: ./htmlgd/tagarea.html