w3resource

HTML usemap attribute

usemap

The purpose of the HTML usemap attribute is to associate an image map with an element. The image map is defined by a MAP element. The value of usemap must match the value of the name attribute of the associated MAP element.

Supported elements

HTML type attribute supports img, input and object elements.

Syntax

<ElementName usemap="value" >.....</ElementName>

Where ElementName is any supported element.

Type of value

URI.

Default value

There is no default value of HTML usemap attribute.

Supported doctypes

HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.

Example of HTML usemap attribute with img element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example of HTML usemap attribute with img element</title>
</head>
<body>
<img src="usemap.gif" alt="usemap   example " width="308" height="190" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="8,5,100,77"   href="../../mysql/mysql-tutorials.php" target="_blank" alt="mysql   tutorial">
<area shape="circle" coords="155,93,59" href="../../php/php-home.php" target="_blank" alt="php tutorial>
<area shape="rect" coords="197,136,306,188" href="../../sql/sql-tutorials.php" alt="sql tutorials">
</map>
</body>
</html>

Result

html usemap attribute with img element

View this example in a separate browser window

Example of HTML usemap attribute with img element

Previous: HTML type attribute
Next: HTML valign attribute

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.