PUBLISHED ON: FEBRUARY 19, 2021
HTML Map Tag
In HTML, the <map>
tag is used along with number of <area>
tag to define an image map.
-
An image-map is an image with clickable link areas.
-
The <map>
tag falls under the category of Inline Elements.
-
The <map>
tag is basically used for the client-side image map.
-
The <map>
tag also requires <img >
tag in order to establish the relationship between image and map or to create an image-map.
HTML <map>
Tag Syntax
The <map>
tag requires the start(opening) tag and end(closing) tag. Following is the basic syntax for the same:
<map>
....content here
</map>
HTML <map>
Tag Basic Example
Below we have a basic example for the same:
HTML <map>
Tag Attributes
This element does not have any specific attributes although this element supports Global and Event attributes.
Other Important attributes of <map>
tag
Name attribute
This attribute is used to give a name so that it can be referenced. This attribute must be present with a non-empty value having no space in it. If the id attribute is also specified then both attributes must have the same value.
Default CSS Settings for HTML <map>
Tag
map {
display: inline;
}
Browser Support for HTML5 <map>
tag
Following browsers support this attribute:
-
Firefox 1+
-
Google Chrome 1+
-
Internet Explorer 2+
-
Apple Safari 1+
-
Opera 4+