HTML <area> tag

Description:

The <area> tag defines the clickable areas or active areas inside the image-map which are associated with the hyperlinks. If you click on those areas then it will perform some action such as open a new image, new URL, etc. This tag is always used with <map> element.

Inside an image map different areas can be hyperlinked to various locations using multiple <area> elements in a single <map> element.

The <area> element is defined with (required) attributes shape and coords. The shape attribute specifies the shape of the area such as rectangle, circle, square, and polygon. The coords attribute defines the coordinates of areas inside the image.

What is Image-map

An image-map is defined as a graphical image with active areas so that when user click on those area, it can link to different destinations. To define an image-map, we require the following things:

  • An HTML <img> element with usemap attribute which defines a valid map name.
  • HTML <map> element with name attribute whose value must be same as usemap
  • One or more <area> elements inside a <map> element which create clickable areas in an image-map.

Syntax

Following are some specifications about the HTML <area> tag

DisplayBlock
Start tag/End tagOnly start tag(End tag forbidden)
UsageImage Map

Example

Test it Now

HTML area tag

Attribute:

Tag-specific attributes:

AttributeValueDescription
alttextAn alternative text String to display on the browser if it does not display the image.
coordsx1,y1,x2,y2(rect)Defines coordinates for the upper left and lower right of a rectangle.
x,y, radius(circle)Defines coordinates for the circle.
x1,y1,x2,y2,x3,y3,..(polygon)Defines the polygon vertices.
hrefhrefURL It determines the hyperlink destination for the active area.
target_blankOpen link in a new window
_parentOpen link in the parent frame
_selfOpen link in current window
_topOpen link with full width in the same window
frame_nameIn the frame. (Not supported in HTML5)
shapedefaultIt defines the default area(rectangular).
rectIt defines the rectangular area.
circleDefines the circular area.
polyDefines the polygonal.
downloadfilenameDefines that hyperlink, which is used for downloading the resource.
relHTML Tags Listalternate
author
bookmark
help
license
next
nofollow
noreferrer
prefetch
prev
search
tag
It defines the relationship between current and linked document.
hreflangHTML Tags Listlanguage_codeIt specifies the language of the linked resource.
typeHTML Tags Listmedia_typeIt specifies the MIME type of linked source.(Not supported in HTML5)

Global attribute:

The <area> tag supports the global attributes in HTML

Event attribute:

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

Supporting Browsers

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




Latest Courses