Register for EarthWeb's Million Dollar Sweepstakes!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


AREA Element: Client-Side Imagemap Mapping Areas

Usage: <AREA>
Can Contain: empty
Can Be Inside: MAP
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
onBlur, onFocus,
ACCESSKEY, ALT, COORDS, HREF, NAME, NOHREF, SHAPE, TABINDEX, TARGET

The AREA element specifies shaped regions in a mapped image and the URLs associated with the shape. The meanings and uses of the attributes are:

ACCESSKEY=“c” (optional; Internet Explorer 4 only) Specifies a typeable character that can be used to access the area. For example, areas in an image could be labeled, using ACCESSKEY, by the letters “a,” “b,” and “c.” If the user then selects the letter “c” on the keyboard, the browser will access the HREF referenced by the AREA with ACCESSKEY=“c.” This functionality is not supported by Netscape Navigator 4 or earlier, but is supported by Internet Explorer 4: With Internet Explorer 4, keys are selected by simultaneously typing the characters ALT-c, where c is the character to select and ALT is the ALT key

ALT=“string” (optional; not widely supported) Gives a text description of the mapped region that can be presented to the user as a description of the linked region or can be used by browsers that cannot display the image. This attribute is not widely supported.

COORDS=“x1,y1,x2,y2.....” (mandatory if SHAPE is not equal to “default”) Specifies the comma-separated coordinates of the defined SHAPE, as a sequence of (x,y) pairs—the required number of pairs depends on the specified SHAPE. Coordinates are specified in pixels measured from the upper left-hand corner of the image. The coordinate specifications for each of the four different SHAPEs are:

SHAPE COORDS Description
“rect” “x1,y1,x2,y2where (x1,y1) are the coordinates of the upper left-hand corner and (x2,y2) are the coordinates of the lower right-hand corner
“circle” xc,yc,rwhere (xc,yc) is the circle center, and (r) is the circle radius
“poly” x1,y1,x2,y2 ... xn,ynwhere (x1,y1) ... (xn,yn) are the coordinates of the vertices of the polygon
“default” N/A the default behavior if the mouse is clicked in an undefined region.

AREAs can overlap—in this case, the browser searches sequentially down through the different AREA elements, and selects the first acceptable entry.

HREF=“url” (one of HREF and NOHREF is required) Specifies the URL to which the region is linked. Note that partial URLs are evaluated relative to the URL of the MAP file—recall that the MAP need not be in the same document as the IMG element referencing the MAP. Similarly, if the document containing the MAP element also contains a BASE element, relative URLs specified by the HREF will be evaluated relative to the base URL.

NAME=string” (optional) Specifies a name identifier for the area. This area is then accessible, via this name, by a JavaScript program. JavaScript (as of Netscape Navigator 3) can then modify the URL referenced by this AREA element.

NOHREF (one of HREF and NOHREF is required) Indicates that the browser should take no action if the user clicks inside the specified region and should continue to display the current document. SHAPE=“rect,” “circle,” “poly,” “default” (optional) Indicates the type of shape being specified in the AREA element. If SHAPE is not specified, a browser assumes the default SHAPE=“rect.” “Default” specifies no area, and corresponds to the default behavior should none of the specified regions be selected.


NOTE:  Problem with Internet Explorer 3 and 4

The Internet Explorer 3 browser does not support the SHAPE values “circle,” “poly,” or “default” (it only supports “rect”), while Internet Explorer 4 does not support the value “default.” All four values are supported by Netscape Navigator 3 and 4.


TABINDEX=number” (optional; Internet Explorer 4 only) Specifies the tabbing order for the linked region. By default, a user can use the tab key to switch between the various anchor elements, active images, and FORM input elements, starting from the top of the document and working down. TABINDEX lets an author change this default order and explicitly set the order of tabbing. Please see the anchor element section for further details. Internet Explorer 4 supports the TABINDEX attribute, but Netscape Navigator 4 does not.

TARGET=string” (optional) Specifies the name of the frame or window to which the returned data should be sent. This attribute is used to the same purpose with the A (anchor element). Please see the anchor element section for further details.

Character-Like Elements

These elements provide character-like behavior within the document. The only such element defined in HTML 4 is BR. The proprietary HTML extensions WBR (word break) and SPACER (an arbitrary text spacing) are described in Chapter 7.

BR Element: Line Break

Usage: <BR>
Can Contain: empty
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, NOFRAMES, NOSCRIPT, P, PRE, TD, TH, character highlighting, A, APPLET, BUTTON, IFRAME, LABEL, LEGEND, OBJECT
Attributes: CLASS, ID, STYLE, TITLE, CLEAR


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.