HTML5 <area> Tag
ExampleAn image-map, with clickable areas:
Try it yourself » |
Definition and Usage
The <area> tag defines an area inside an image-map (an image-map is an image with clickable areas).
The area element is always nested inside a <map> tag.
Note: The usemap attribute in the <img> tag is associated with the map element's name attribute, and creates a relationship between the image and the map.
Differences Between HTML 4.01 and HTML5
HTML5 has some new attributes, and some HTML 4.01 attributes are no longer supported.
Attributes
New : New in HTML5.
Attribute | Value | Description |
---|---|---|
alt | text | Specifies an alternate text for the area. Required if the href attribute is present |
coords | coordinates |
Specifies the coordinates of an area |
href | URL | Specifies the target URL of the area |
hreflangNew | language_code | Specifies the language of the target URL |
mediaNew | media query | Specifies what media/device the target URL is optimized for. Default value: all |
nohref | nohref | Not supported in HTML5 |
relNew | alternate archives author bookmark external first help index last license next nofollow noreferrer prefetch prev search sidebar tag up |
Specifies the relationship between the current document and the target URL |
shape | rect rectangle circ circle poly polygon |
Specifies the shape of the area |
target | _blank _parent _self _top framename |
Specifies where to open the target URL |
typeNew | mime_type | Specifies the MIME type of the target URL |
Standard Attributes
The <area> tag also supports the Standard Attributes in HTML5.
Event Attributes
The <area> tag also supports the Event Attributes in HTML5.