HTML <map> tag is used with <area> tag to define a client-side image map.

An image map is consist of an image with clickable areas, where you can click on the image, and it will open to new or the provided destination.

The <map> tag can consist of more than one <area> elements which define the coordinates and type of the area.

With the help of <map> tag, you can easily link any part of the image to other documents, without dividing the image.

Syntax

<map name=" ">  

Following are some specifications about the HTML <map> tag

DisplayNone
Start tag/End tagEmpty Tag(Only Start tag)
UsageImage map

Example

    <!DOCTYPE html>  
    
    <html>  
    
     <head>  
    
    <title>HTML map tag</title>  
    
    <style>  
    
      body{  
    
      margin-left: 250px;}  
    
    </style>  
    
      </head>  
    
     <body>  
    
     <h2>Example of HTML Map tag</h2>  
    
    <img src="image1.png" usemap="#web">  
    
    <map name="web">  
    
    <area shape="rect" coords="66,117,131,168" href="https://www.javatpoint.com/html-tutorial">  
    
    <area shape="rect" coords="199,36,277,85" href="https://www.javatpoint.com/css-tutorial">  
    
    <area shape="rect" coords="330,107,406,159" href="https://www.javatpoint.com/bootstrap-tutorial">  
    
    <area shape="rect" coords="199,185,267,236" href="https://www.javatpoint.com/javascript-tutorial">  
    
     </map>  
    
     </body>  
    
    </html>

    Attribute:

    Tag-specific attributes:

    AttributeValueDescription
    namemapnameIt defines the name of the image-map.

    Global attribute:

    The <map> tag supports the global attributes in HTML

    Event attribute:

    The <map> tag supports the event attributes in HTML.

    Supporting Browsers

    Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
    <map>YesYesYesYesYes

    Comments

    Leave a Reply

    Your email address will not be published. Required fields are marked *