HTML » Tags » map

Version: 3.2, 4.0

Compability: Explorer 4, 5  Netscape 4, 6

Syntax:
<map> ... </map>

The <map> tag is used to create a client-side image map which is divided into two or more mouse-sensitive regions.

For example, when you click onto a specific region of the image map, a hyperlink could send you to a target page or a pop-up window could display some information.

The map element essentially serves as a container for the code that creates and implements the image map. For example, this code could be a series of area tags that are used to set image coordinates and to assign a hyperlink to each region of the image map. Also, since the image map is mouse-sensitive, you could also use any of the onmouse core attributes to capture a mouse event and execute a JavaScript code.
 
The closing tag is mandatory.
 

Examples

Code:
<img border="0" src="/images/asp_method_event_property.gif" usemap="#methodproperty">
<br>
<map name="methodproperty">
<area shape="rect" coords="192,0,248,26" href="/technologies/asp/quickref/properties.html">
<area shape="rect" coords="133,0,191,26" href="/technologies/asp/quickref/collections.html">
<area shape="rect" coords="90,0,134,22" href="/technologies/asp/quickref/events.html">
<area shape="rect" coords="43,0,89,22" href="/technologies/asp/quickref/methods.html">
</map>
Explanation:

In this example, an image of a menu is displayed, and the area and map tags are used to create image mapped links to various indexes pages.

Language(s): HTML

See Also: