MyInternships.in

HTML Tags

HTML <area> Tag

The <area> tag defines a clickable hotspot inside an image map, letting different regions of a single image link to different destinations. It is always used inside a <map> element.


The <area> Tag

The <area> element specifies a region of an image map that is clickable and can act as a hyperlink. Each <area> defines one hotspot with a shape (rectangle, circle, or polygon), its coordinates, and a destination.

It is a void element used only inside a <map>. The map is then connected to an image using the image's usemap attribute.

Syntax

An area hotspot inside a named map.
Example
<map name="mymap">
  <area shape="rect" coords="0,0,100,100" href="page.html" alt="Region" />
</map>

Example

An image split into two clickable regions.
Example
<!DOCTYPE html>
<html>
  <body>
    <h1>Image Map Demo</h1>
    <img src="https://picsum.photos/200" alt="Clickable image" usemap="#demomap" />
    <map name="demomap">
      <area shape="rect" coords="0,0,100,200"
            href="https://www.wikipedia.org/" alt="Left half" />
      <area shape="rect" coords="100,0,200,200"
            href="https://www.mozilla.org/" alt="Right half" />
    </map>
    <p>Click the left or right half of the image.</p>
  </body>
</html>

More Examples

A circular hotspot using shape="circle".
Example
<!DOCTYPE html>
<html>
  <body>
    <img src="https://picsum.photos/200" alt="Map" usemap="#circlemap" />
    <map name="circlemap">
      <area shape="circle" coords="100,100,80"
            href="https://example.com" alt="Center circle" />
    </map>
    <p>A circular hotspot at the centre of the image.</p>
  </body>
</html>

Attributes

AttributeDescription
shapeThe hotspot shape: rect, circle, poly, or default.
coordsCoordinates defining the hotspot, depending on the shape.
hrefThe URL the hotspot links to.
altAlternative text, required when href is present.
targetWhere to open the link, for example _blank.
💡

Always provide an alt attribute on every clickable <area> for accessibility. Screen readers rely on it to describe each hotspot.

Key Takeaways

  • <area> defines a clickable hotspot in an image map.
  • It lives inside a <map>, linked to an image via usemap.
  • shape and coords define the hotspot geometry.
  • It is a void element and needs alt text.
  • Shapes can be rect, circle, poly, or default.

Related HTML Topics

Keep learning with these closely related tutorials.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships