<area>

  • Revision slug: HTML/Element/area
  • Revision title: area
  • Revision id: 81574
  • Created:
  • Creator: PablO
  • Is current revision? No
  • Comment /* Notes */

Revision Content

HTML Area Element

<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.

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.

Example

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

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.


{{wiki.template('HTML:Element_Navigation')}}

Revision Source

<h2 name="HTML_Area_Element"> HTML <i>Area</i> Element </h2>
<p><b>&lt;area&gt;</b> - Defines a hot-spot region on an image, and associates it with a hypertext link. This element is used only within a <code>&lt;map&gt;</code> tag.
</p>
<h3 name="Attributes"> Attributes </h3>
<dl><dt>accesskey
</dt><dd>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.
</dd></dl>
<dl><dt>alt
</dt><dd>This attribute contains a text string alternative to display on browsers that cannot display images.
</dd></dl>
<dl><dt>coords
</dt><dd>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.
</dd></dl>
<dl><dt>href
</dt><dd>This attribute specifies the hyperlink target for the area. Its value is a valid URL. Either this attribute or the <b>nohref</b> attribute must be present in the element.
</dd></dl>
<dl><dt>name
</dt><dd>This attribute is used to define a name for the clickable area so that it can be scripted by older browsers.
</dd></dl>
<dl><dt>nohref
</dt><dd>This attribute indicates that no hyperlink exists for the associated area. Either this attribute or the <b>href</b> attribute must be present in the element.
</dd></dl>
<dl><dt>shape
</dt><dd>This attribute defines the shape of the associated hot spot. HTML 4 defines the values <b>rect</b>, which defines a rectangular region; <b>circle</b>, which defines a circular region; poly, which defines a polygon; and <b>default</b>, which indicates the entire region beyond any defined shapes. Many browsers, notably Internet Explorer 4 and higher, support <b>circ</b>, <b>polygon</b>, and <b>rectangle</b> as valid values for <b>shape</b>.
</dd></dl>
<dl><dt>tabindex
</dt><dd>This attribute represents a numeric value specifying the position of the defined area in the browser tabbing order.
</dd></dl>
<dl><dt>target
</dt><dd>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 <b>_blank</b> indicates a new window. A value of <b>_parent</b> indicates the parent frame set containing the source link. A value of <b>_self</b> indicates the frame containing the source link. A value of <b>_top</b> indicates the full browser window.
</dd></dl>
<h3 name="Example"> Example </h3>
<pre>&lt;map name="primary"&gt;
&lt;area shape="circle" coords="200,250,25" href="another.htm" /&gt; 
&lt;area shape="default" nohref /&gt;
&lt;/map&gt;
</pre>  
<h3 name="Notes"> Notes </h3>
<p>Under the HTML 3.2 and 4.0 specifications, the closing tag <code>&lt;area&gt;</code> is forbidden.
</p><p>The XHTML 1.0 specification requires a trailing slash: <code>&lt;area /&gt;</code>.
</p><p>The <b>id</b>, <b>class</b>, and <b>style</b> attributes have the same meaning as the core attributes defined in the HTML 4 specification, but only Netscape and Microsoft define them.
</p><p>Netscape 1–level browsers do not understand the target attribute as it relates to frames.
</p><p>HTML 3.2 defines only <b>alt</b>, <b>coords</b>, <b>href</b>, <b>nohref</b>, and <b>shape</b>.
</p><p><br>
{{wiki.template('HTML:Element_Navigation')}}
</p>
Revert to this revision