HTML <map> tag

Usage

Defines an image map, which allows the user to click on different parts of an image to link to different pages.

Example

Code:

<img src="/images/imagemap.gif" alt="Image map" usemap="#imagemap" />

<map id="imagemap" name="imagemap">
<area shape="rect" coords="64, 18, 222, 135" href="pete.htm" alt="Rectangle" />
<area shape="circle" coords="227, 215, 60" href="circle.htm" alt="Circle" />
<area shape="poly" coords="18,253,113,151,153,284" href="triangle.htm" alt="Triangle" />
</map>

Output:

Image map Rectangle Circle Triangle

Required Attributes

  • id - provides a unique identifier for the map

Optional Attributes

  • name - assigns a unique name

Core Attributes