(There are examples at the bottom of the page, to use as a reference.)
First you need to create the map. You need some sort of graphics program to tell you the coordinates of the various points on the picture (in pixels).
To do this using rectangular shapes:
For a circular shape:
You can do this by a) finding the right hand point on the circle and its x-coordinate (here it is 103), then b) subtract the x-coordinate of the center of the circle, x1. eg. 103-x1 = 103-61 = 42
Now that you have the coordinates of the shapes, you can make a list which will tell the browser where on an image the different areas can be found.
<map name="mapname">
<area shape="rect" coords="11,0,96,94" href="http://www.austen.com/tutorial/blue.htm">
</map>
<img src="http://www.austen.com/tutorial/imgmap1.gif" usemap="#mapname" border=0>
<img src="http://www.austen.com/tutorial/imgmap1.gif" usemap="#demomap" border=0>
<map name="demomap">
<area shape="rect" coords="11,0,96,94" href="http://www.austen.com/tutorial/blue.htm">
<area shape="rect" coords="96,0,174,94" href="http://www.austen.com/tutorial/red.htm">
<area shape="rect" coords="174,0,255,94" href="http://www.austen.com/tutorial/pink.htm">
</map>
Results in (I drew on the lines to show the shapes, but on imagemaps they are invisible):
Note that here the full URL is not used, but only the relative one. Since the link is to a file in the same directory, all you need is the file name, not the entire address (http://...etc.)
<img src="http://www.austen.com/tutorial/imgmap1.gif" usemap="#demo2" border=0>
<map name="demo2">
<area shape="circle" coords="61,48,42" href="blue.htm">
<area shape="circle" coords="138,48,35" href="red.htm">
<area shape="circle" coords="211,48,38" href="pink.htm">
</map>
Results in (I drew on the lines to show the shapes, but on imagemaps they are invisible):
In this example the addresses are given in short hand. When an address begins with a slash "/", then the "http://www.austen.com" part of the address is assumed to come before it.
<img src="http://www.austen.com/tutorial/imgmap3.gif" usemap="#demo3" border=0>
<map name="demo3">
<area shape="polygon" coords="38,22,60,13,77,21,86,36,80,60,35,61,27,39" href="/tutorial/blue.htm">
<area shape="polygon" coords="104,20,170,15,168,65,93,67" href="/tutorial/red.htm">
<area shape="polygon" coords="203,3,223,13,236,48,220,67,180,52,181,4" href="/tutorial/pink.htm">
</map>
Results in (I drew on the lines to show the shapes, but on imagemaps they are invisible):
© 1998, 1999, 2000 Copyright held by Ann Haker.