Open In App

HTML | <map> name Attribute

Last Updated : 21 Jun, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

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:

  • name: it specify the name of the image map.

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:

  • Google Chrome version 1 and above
  • Edge version 12 and above
  • Firefox version 1 and above
  • Internet Explorer 
  • Opera 
  • Safari 1 and above

Next Article

Similar Reads