Image maps are used in combination with <img> element and allow users to click on a specified region of an image and execute certain action with it.
The image maps can be a client-side image map or server-side image map.
The area element is a child element to the <map> (image map) element and it specifies the shape and coordinates of desired region within an image.
Coordinates depend on the shape of the chosen region and are relative to the top-left corner of the object.
The image maps are very popular with online maps. For instance a geographical map of U.S.A. that has states divided as image map regions which lets visitors follow the links by clicking on a particular state.
Area is an empty element, therefore the closing tag is forbidden.
<map name=""><area shape="" coords="" /></map>
- id, class (document-wide identifiers)
- lang (language information), dir (text direction)
- title (element title)
- style (inline style information)
- alt (<area />) (alternate text)
- name (<map>) (elements name)
- shape, coords, nohref, usemap (<area />) (image area specific attributes)
- href (anchor reference)
- target (<area />) (frame target information)
- tabindex (<area />) (tabbing navigation)
- accesskey (<area />) (access keys)
- onfocus (<area />), onblur (<area />), onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)
HTML image map elements: