NOTICE: This website is no longer updated or supported - as such many of the techniques used to build it may seem antiquated in the modern day. It is preserved for historical reasons only.

HTML XHTML The Complete Reference
home » reference » appendix a » html element reference

<map> (Client-Side Image Map)


This element is used to implement client-side image maps. The element is used to define a map to associate locations on an image with a destination URL. Each hot region or hyperlink mapping is defined by an enclosed <area> element. A map is bound to a particular image through the use of the usemap attribute in the <img> element, which is set to the name of the map.

Standard Syntax


<map
class="class name(s)"
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
name="unique alphanumeric identifier"
style="style information"
title="advisory text"
</map>

Standard Event Attributes


onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup

Events Defined by Internet Explorer


onbeforeactivate, onbeforecut, onbeforepaste, oncut, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onpaste, onpropertychange, onreadystatechange, onscroll, onselectstart

Element Specific Attributes


name
Like id, this attribute is used to define a name associated with the element. In the case of the map element, the name attribute is the common way to define the name of the image map to be referenced by the usemap attribute within an <img> tag.

Example


<map name="mainmap">
  <area shape="circle" coords="200,250,25"
   href="file1.htm">
  <area shape="rectangle" coords="50,50,100,100"
   href="file2.htm#important">
  <area shape="default" nohref>
</map>

Compatibility


HTML 3.2, 4, 4.01, XHTML 1.0, 1.1
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1, 2, 3, 4-4.7, 6, 7
Opera 4-7

Notes


HTML 3.2 supports only the name attribute for the <map> element.
Client-side image maps are not supported under HTML 2. They were first suggested by Spyglass and later incorporated in Netscape and other browsers.

(X)HTML Elements
CSS Properties
Previous: listing Next: marquee
< Home | About | Chapters | Examples | Errata | Reference | Site Map >