Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML tag

HTML tag

Example

An image map with clickable areas:

<

img

src

=

"

planets.gif

"

width

=

"

145

"

height

=

"

126

"

alt

=

"

Planets

"

usemap

=

"

#planetmap

"

<

map

name

=

"

planetmap

"

<

area

shape

=

"

rect

"

coords

=

"

0,0,82,126

"

alt

=

"

Sun

"

href

=

"

sun.htm

"

<

area

shape

=

"

circle

"

coords

=

"

90,58,3

"

alt

=

"

Mercury

"

href

=

"

mercur.htm

"

<

area

shape

=

"

circle

"

coords

=

"

124,58,8

"

alt

=

"

Venus

"

href

=

"

venus.htm

"

map

Try it »


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support tag.


Tag Definition and Usage Notes

The tag defines a region inside an image map (an image map is an image with clickable areas).

The element is always nested inside the tag.

Note: The usemap attribute in the tag is associated with the name in the element, to create the relationship between the image and the map.


Differences between HTML 4.01 and HTML5

HTML5 provides some new attributes and no longer supports some attributes from HTML 4.01.


Differences between HTML and XHTML

In HTML, the tag has no end tag.

In XHTML, the tag must be closed properly.


property

New : New attributes in HTML5.

property Value Description
alt text Specifies the alternative text for a region. This attribute is required if the href attribute is used.
coords coordinates Specifies the coordinates of a region.
href URL Specifies the target URL of a region.
hreflangNew language_code Specifies the language of the target URL.
mediaNew media query Specifies which medium/device the target URL is optimized for. Default: all.
nohref value Not supported in HTML5. Specifies a region with no associated link.
relNew alternate
 author       

 bookmark       

 help       

 license       

 next       

 nofollow       

 noreferrer       

 prefetch       

 prev       

 search       

 tag | Specifies当前文档与目标 URL 之间的关系。 |

| shape | default
rect
circle
poly | Specifies the shape of a region. | | target | _blank
_parent
_self
_top
framename | Specifies where to open the target URL. | | typeNew | MIME_type | Specifies the MIME type of the target URL.
Note: MIME = Multipurpose Internet Mail Extensions. |

Global Attributes

The tag supports HTML Global Attributes.


Event attribute

The tag supports HTML Event Attributes.


Related Articles

HTML DOM Reference Manual: Area Object