Search code examples
htmlareaimagemap

What is the last area tag in an img map for?


So I am working on a project requiring the use of img maps. I have little experience with them and have been trying to understand why their last area tag is usually as follows.

    <img class="img_class" id="squares" src="../images/squares.jpg" usemap="#sq_map">
    <map name="sq_map">
      <area shape="rect" href="#" coords="120,40,200,120"  title="blu"  id="1" alt="blu_sq"/>
      <area shape="rect" href="#" coords="120,200,200,280" title="red"  id="2" alt="red_sq"/>
      <area shape="default" nohref="nohref" alt="">
    </map>

I have my main map set up of my clickable areas but I am not sure what that third tag is for. Is it to block the default process when the image is clicked on or something along those lines? Google has been surprisingly unfruitful on this topic but I will keep looking in the mean time. Thank you for the help!


Solution

  • <area shape="default" nohref="nohref" alt="">
    

    shape="default" means select the entire region.
    nohref means no link is associated.

    Hope this may help you. :)