Introduction
An image-map is an image with clickable areas. The <map> tag is supported in all major browsers. An image map is one image with multiple "clickable" areas. Attributes consist of a name and a value separated by an equals (=) sign, with the value surrounded by double-quotes. This attribute is associated with the <img>'s usemap attribute and creates a relationship between the image and the map.
Image
First of all, you need a suitable graphic. An image that cannot be divided into different sections is not your best choice, but an image that has clear cut-offs or lines would be better. Of course, this does not apply to navigational menus or similar, just to everyday pictures like animals, objects or people.
Co-ordinates
You'll need different co-ordinates depending on what sort of "hot spot" you'd like to use.
-RECT
-CIRCLE
-POLYGON
Attributes
HTML tags can contain one or more attributes. Attributes are added to a tag to provide the browser with more information about how the tag should appear or behave.
Attributes consist of a name and a value separated by an equals (=) sign, with the value surrounded by double-quotes.
There are 3 kinds of attributes that you can add to your HTML tags: Element-specific, global, and event handler content attributes.
Element-Specific Attributes
The following table shows the attributes that are specific to this tag/element.
Attributes Introduced by HTML5
| Attributes | Description |
| name | Assigns a name to the image map. |
Global Attributes
The following attributes are standard across all HTML 5 tags.
|
HTML5 Global Attributes
|
||
| accesskey | draggable | style |
| class | hidden | tabindex |
| dir | spellcheck | |
| contenteditable | id | title |
| contextmenu | lang | |
Event Handler Content Attributes
Here are the standard HTML 5 event handler content attributes.
| onabort | onerror* | onmousewheel |
| onblur* | onfocus* | onpause |
| oncanplay | onformchange | onplay |
| oncanplaythrough | onforminput | onplaying |
| onchange | oninput | onprogress |
| onclick | oninvalid | onratechange |
| oncontextmenu | onkeydown | onreadystatechange |
| ondblclick | onkeypress | onscroll |
| ondrag | onkeyup | onseeked |
| ondragend | onload* | onseeking |
| ondragenter | onloadeddata | onselect |
| ondragleave | onloadedmetadata | onshow |
| ondragover | onloadstart | onstalled |
| ondragstart | onmousedown | onsubmit |
| ondrop | onmousemove | onsuspend |
| ondurationchange | onmouseout | ontimeupdate |
| onemptied | onmouseover | onvolumechange |
| onended | onmouseup | onwaiting |



Join the conversation! Your thoughts help the community grow.