Summary -

In this topic, we described about the <map> tag along with detailed example.

To declare client side image map. Image map is nothing but a image which had a clickable areas on it. The <map> tag is used for declaring an image map.

<map> tag can be specified along with <area> and <img> tags. The tag can be specified like <map name=""></map> with in between the opening and closing tags.

<map> tag is nested tag. Ending tag is required for <map> tag.

Syntax -

<map>HTML text here </map>

Required Attributes -

AttributeDescriptionValues
TypeSpecifies the name of the image mapMap name

Example -

<!DOCTYPE html>
<html>
	<head>
		<title> map tag example</title>
	</head>
	<body>
		<img src="india.png" width="500" height="600" 
		alt="India" usemap="#indiamap">
		<map name="indiamap">
			<area shape="rect" coords="0,0,500,300" 
			alt="North India">
			<area shape="rect" coords="0,300,500,600" 
			alt="South India">
		</map>
	</body>
</html>

Output -

India North India South India