You are here:  NetStrider » Tutorials » HTMLRef » Commands » AREA «

HTML Reference Guide

Author: Randy D. Ralph.   In place March 1, 1999.   Copyright © 1999 NetStrider.   Presented as a public service.

BACK <AREA> Command next

Command Syntax:

<AREA command parameters>

The <AREA> command is used only within the <MAP> command to establish a clickable image area within a displayed inline image and to associate an URL with that area.

Note that a separate <AREA> statement must be provided for each defined image area within the inline image.

See also: <MAP>

Command Parameters: 
coords="x1,y1,x2,y2, . . ."
coords="x,y,r"

Define the coordinates used to proscribe the image area.  Different shapes require different coordinate parameter patterns:

  1. A circle:

    x,y define the center of the circle
    r defines the radius of the circle in pixels.

  2. An irregularly shaped polygon:

    x1,y1 define the first vertex
    x2,y2 define the second vertex
    x3,y3 define the third vertex, etc.

  3. A rectangle or a square:

    x1,y1 define the upper lefthand corner of a rectangular shape
    x2,y2 define the lower righthand corner of a rectangular shape

Note:  Individual image areas must be defined separately within independent <AREA> statements inside the <MAP> command.

See also:  <MAP>.

href="URL"

Requires that a valid URL be provided.  This associates the defined image area with an Internet address.

On mouseover and click on the defined image area the user is directed to the associated URL just as with any other hypertext link.

nohref

Declares that the image area is not associated with any URL and that mouseover and click will result in no action.

shape="shape type"

Optionally declares the shape type that is associated with the image area.  Allowable values are:

circle - a circle
rect - a rectangle or square
poly - an irregularly shaped polygon

target="frame name"

Optionally declares a target for the supplied URL for use in framed documents where a named frame must be addressed.

Example:
<MAP name="htmlref">
  <AREA shape="rect"   coords="1,1,10,20"       href="index.html">
  <AREA shape="circle" coords="50,50,10"        href="toc.html">
  <AREA shape="poly"   coords="20,1,40,1,30,20" href="banner.html">
</MAP>

The statements above define a client-side image map named htmlref.  This map contains three defined image areas.  Shape, coordinates and hypertext reference links are established for each defined image area.

Return to Section A:D


Return to the List of Commands.
Author: Randy D. Ralph.  In place March 1, 1999.  Copyright © 1999 NetStrider.  World Rights reserved.




Hosted by uCoz