HTML XHTML The Complete Reference
home » reference » appendix a » html element reference

<area> (Image Map Area)


Defines a hot-spot region on an image, and associates it with a hypertext link. This element is used only within a <map> tag.

Standard Syntax


<area
accesskey="character"
alt="alternative text"
class="class name(s)"
coords="comma separated list of values"
dir="ltr | rtl"
href="url"
id="unique alphanumeric identifier"
lang="language code"
nohref="nohref"
shape="circle | default | poly | rect"
style="style information"
tabindex="number"
target="_blank | frame-name | _parent | _self |
_top" (transitional or frameset only)
title="advisory text" />

Attributes Defined by Internet Explorer


language="javascript | jscript | vbs | vbscript" (4)
hidefocus="true | false" (5.5)
unselectable="off | on" (5.5)

Standard Events


onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer


onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror

Element Specific Attributes


accesskey
This attribute specifies a keyboard navigation accelerator for the element. Pressing ALT or a similar key in association with the specified character selects the form control correlated with that key sequence. Page designers are forewarned to avoid key sequences already bound to browsers.

alt
This attribute contains a text string alternative to display on browsers that cannot display images.

coords
This attribute contains a set of values specifying the coordinates of the hot-spot region. The number and meaning of the values depend upon the value specified for the shape attribute. For a rect or rectangle shape, the coords value is two x,y pairs: left, top, right, and bottom. For a circ or circle shape, coords value is x,y,r where x,y is a pair specifying the center of the circle and r is a value for the radius. For a poly or polygon shape, the coords value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on.

href
This attribute specifies the hyperlink target for the area. Its value is a valid URL. Either this attribute or the nohref attribute must be present in the element.

name

This attribute is used to define a name for the clickable area so that it can be scripted by older browsers.

nohref
This attribute indicates that no hyperlink exists for the associated area. Either this attribute or the href attribute must be present in the element.

shape
This attribute defines the shape of the associated hot spot. HTML 4 defines the values rect, which defines a rectangular region; circle, which defines a circular region; poly, which defines a polygon; and default, which indicates the entire region beyond any defined shapes. Many browsers, notably Internet Explorer 4 and higher, support circ, polygon, and rectangle as valid values for shape.

tabindex
This attribute represents a numeric value specifying the position of the defined area in the browser tabbing order.

target
This attribute specifies the target window for hyperlink referencing frames. The value is a frame name or one of several special names. A value of _blank indicates a new window. A value of _parent indicates the parent frame set containing the source link. A value of _self indicates the frame containing the source link. A value of _top indicates the full browser window.

XHTML Example


<map name="primary">
<area shape="circle" coords="200,250,25" href="another.htm" /> <area shape="default" nohref />
</map>

Compatibility


HTML 2, 3.2, 4, 4.01, and XHTML 1.0, 1.1, Basic
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1, 2, 3, 4- 4.7, 6, 7
Opera 4-7

Notes


Under the HTML 3.2 and 4.0 specifications, the closing tag <area> is forbidden.

The XHTML 1.0 specification requires a trailing slash: <area />.

The id, class, and style attributes have the same meaning as the core attributes defined in the HTML 4 specification, but only Netscape and Microsoft define them.

Netscape 1–level browsers do not understand the target attribute as it relates to frames.

HTML 3.2 defines only alt, coords, href, nohref, and shape.

(X)HTML Elements
CSS Properties
Previous: applet Next: b
< Home | About | Chapters | Examples | Errata | Reference | Site Map >