An HTML image map can create “hotspots” on a single image to give it multiple clickable areas.
This example shows how to create a circular “wheel spokes” or “pie” style image map with clickable segments or slices. There are three types of area shapes that can be mapped, “rect”, “circle”, and “polygon” (or “poly”). In this example we’ll only use the “polygon” shape because we’ll need to use custom lines and angles for our slices. This example uses triangle shaped clickable areas for each slice because unfortunately image maps don’t allow arc shaped areas with one curved edge.
Try clicking each coloured segment of this image…

How to create the image map?
- Find an image or make one (download sample wheel PNG)
- Store the image somewhere reference-able
- Write the html (see example below)
- write the <map> tag and give it a “name” attribute and give it a value e.g. name=”wheel”
- write an <area> tag, give it a “shape” attribute with value “poly”
- give the <area> tag another attribute called “coords”. It’s value will be a series of numbers that make up the co-ordinates of each point of the shape in order. e.g. coords=” x coord 1, y coord 1, x coord 2, y coord 2, x coord 3, y coord. (Hint: the reference points for these coordinates are the left side and the top side of the image that is using this map. I.e. the coordinate “0,0″ is the top left corner of the image.)
- give the <area> tag another attribute called “href” with the value of a URL. This is the address that the particular area of the image will link to when clicked.
- write more <area> tags as required
- write the <img> tag and reference the stored image (example below)
- give the <img> tag an attribute “usemap” with the value “#wheel” (don’t forget the hash “#”)
- View the finished HTML in a browser and click away!
Example HTML
<img src="http://dhyanascarano.com/wp-content/uploads/2011/12/Colour-wheel.png" usemap="#wheel"/> <map name="wheel"> <area shape="poly" coords="236,236,35,120,35,352" href="http://en.wikipedia.org/wiki/Magenta"> <area shape="polygon" coords="236,236,236,0,35,120" href="http://en.wikipedia.org/wiki/Blue"> <area shape="polygon" coords="236,236,436,120,236,0" href="http://en.wikipedia.org/wiki/Aqua_(color)"> <area shape="polygon" coords="236,236,436,352,436,120" href="http://en.wikipedia.org/wiki/Yellow"> <area shape="polygon" coords="236,236,236,473,436,352" href="http://en.wikipedia.org/wiki/Green"> <area shape="polygon" coords="236,236,236,473,35,352" href="http://en.wikipedia.org/wiki/Red"> </map>
References
To learn more about image maps take a look at these resources:
- For developers: https://developer.mozilla.org/en/HTML/Element/map

- In plain english: http://www.javascriptkit.com/howto/imagemap.shtml

- W3 Schools: http://www.w3schools.com/tags/tag_map.asp

- W3C recommendation: http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.6
