AREA (<area>) Tag

by Jai 20-May-19

0 391


The HTML <area> tag is used to describe an area in a specific region. One can easily outline certain sections inside an image map. Generally, it is used to create clickable areas inside an image-map i.e. to generate hyperlinks, so that whenever any user click on those areas, it will perform some specific defined actions such as new URL redirection, open other image, or to target another tab, etc.

How it is used
This tag is always used with <map element>.

Usage
a) This tag is used when there is a need to have multiple hyperlinks on any image within a page.
b) The <area> element is defined with (required) attributes i.e. shape and coords.
c) The shape attribute specifies the shape of the area such as rectangle, circle, square, and polygon.
d) The coords attribute defines the coordinates of areas inside the image.

Code:

<!DOCTYPE html>
<html>
<head>
<title> Area tag</title>
</head>
<body>
<h1> Example of Area tag </h1>
<img src="download.jpg" usemap="#web">
<map name="web">
<area shape="rect" href="https://www.codingtag.com/html" coords="30,50,50,30"
alt="rect hyperlink in one img" title="rect hyperlink">

<area shape="circle" coords="90,18,100" href="https://www.codingtag.com/php-introduction"
alt="circle hyperlink in one img" title="circle hyperlink">
</map>
</body>
</html>

Output:

AREA (<area>) Tag

AREA (<area>) Tag


Share:


Comments

    Waiting for your comments

Leave a Reply