HTML usemap attribute

usemap attribute represents the name of the image map to use for the map.

<img src="files/three images.jpg" usemap="#shapes" alt="shape of circle">
 <map name="shapes">
  <area alt="triangle" title="triangle" href="triangle.html" shape="poly" coords="13,122,50,61,86,123" />
</map>
</>
shape of circle triangle

src attribute defines the location of the image. href attribute defines a link on an area.

Attribute values

All possible values of usemap attribute

The value of usemap attribute is the name of the image followed by hash.

Attribute values

All possible values of usemap attribute

<img> tag

Img element adds an image in the web page. See the example above.

<object> tag

object element represents embedded content such as images, video or audio. It also references the image to the map.



Was this article helpful?