Skip to content
Related Articles
Open in App
Not now

Related Articles

How to specify the hyperlink target for the area of an image in HTML5 ?

Improve Article
Save Article
  • Last Updated : 28 Apr, 2021
Improve Article
Save Article

The href attribute is used to specify the hyperlink target for the area in HTML5. The area tag is not a hyperlink in itself. The <a> tag should always have an opening as well as a closing tag. The coords attribute is obsolete on an element. Instead, always use the area tag for the image map where coords attribute can be used within the area tag. The same should also be applied to shape attributes. The following example states it clearly.    


<area href = "URL">



<!DOCTYPE html>
  <body style="text-align: center">
    <h1 style="color: green">GeeksforGeeks</h1>
    <h2>Use of href attribute in area tag.</h2>
    <map name="gfg">
      <!-- You'll be able to go to the link only 
                when clicked on top-left corner -->
        coords="0, 0, 50, 50"


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!