Last Updated : 21 Jun, 2022
The HTML <map> name Attribute is used to specify the name of the mapping image, This attribute is associated with the <img> usemap attribute and created the relationship between the image and the map.
Syntax:
<map name="mapname">
Attribute Values:
Example:
html
<!DOCTYPE html>
<html>
<head>
<title>
HTML name Attribute
</title>
</head>
<body style="text-align:center;">
<h1>GeeksForGeeks</h1>
<h2>HTML map name Attribute</h2> `
<map id="Geeks" name="Geeks">
<area shape="rect"
coords="0, 0, 110, 100"
alt="Geeks"
href=
"https://media.geeksforgeeks.org/wp-content/uploads/a1-21.png">
<area shape="rect"
coords="110, 0, 190, 100"
alt="For"
href=
"https://media.geeksforgeeks.org/wp-content/uploads/a1-22.png">
<area shape="rect"
coords="190, 0, 300, 100"
alt="GEEKS"
href=
"https://media.geeksforgeeks.org/wp-content/uploads/a1-24.png">
</map>
<img src=
"https://media.geeksforgeeks.org/wp-content/uploads/a1-25.png"
width="300"
height="100"
alt="GFG"
usemap="#Geeks">
</body>
</html>
Output:
Before:
After:
Supported Browsers: The browsers supported by HTML <map> name Attribute are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4