The <area> tag has no end tag in HTML5.
HTML5 <area> tag
The <area> tag defines a clickable area as a hotspot inside an image-map where the user can click.
You must place the <area> tag inside the <map> tag.
<img usemap=”mapid” src=”imagepath”>
<area shape=”type” coords=”points” href=”hyperlink” >
CSS Default Value
How Browser will display
Difference between HTML4.01, XHTML and HTML5
|HTML4.01 does not support some outdated attributes.||<area> tag must have a trailing slash as <area/> to mark the end of the tag||HTML5 contains some new attributes. It does not support some old attributes of HTML4.01|
Attributes used with <area> tag
|shape||It describes shape of the area. The values which shape can take are-
|coords||It sets the size and position of the shape attribute by using the coordinates.
|href||It defines the target hyperlink using a URL.|
|alt||When browser is not able to load the image or the hyperlink then it is an alternative text should which will be displayed to the user. It is a good practice to add this attribute when you code the href attribute.|
|download||It enables the target link as a download link to download the target object. Safari, IE and Opera Version 12 and prior does not support this attribute.|
|hreflang||It defines language code of linked URL.|
|media||This attribute is new in HTML5. It defines the media or device for which the target URL is created. It uses media query.|
|nohref||Informs the browser that a particular area does not have a target link URL.
(HTML5 does not support this attribute).
|type||Sets the type of media for the target URL.|
|rel||This relates the current HTML document with the target link URL. This can take the following values -
|target||This informs the browser how to open the target URL.
This means, it does not pass link juice to the target URL. Link Juice heps in increasing the SEO of a HTML document.
This tells the browser that the current HTML document does not value the target URL so search engine like Google will consider the target link like a paid link.
The <area> tag supports Global Attributes.
The <area> tag supports Event Attributes.