|
|
HTML <area> tag
Syntax
<area>
Definition and Usage
The AREA element defines a map region
in a client-side image map. Each map region is a piece
of the image with a different action when clicked. This element is always nested
inside a <map> tag.
Required Attributes
| Attribute |
Value |
Description |
| alt |
text |
Specifies an alternate text for the area |
Optional Attributes
| Attribute |
Value |
Description |
| coords |
if shape="rect" then
coords="left,top,right,bottom"
if shape="circle" then
coords="centerx,centery,radius"
if shape="poly" then
coords="x1,y1,x2,y2,..,xn,yn"
|
Specifies the coordinates for the clickable area |
| href |
URL |
Specifies the target URL of the area |
| nohref |
true
false |
Excludes an area from the image map |
| shape |
rect
circle
poly
default |
Defines a rectangular region
Defines a circular region
Defines a polygonal region
Defines the whole region |
| target |
_blank
_parent
_self
_top |
Where to open the target URL.
- _blank - the target URL will be opened in a new window
- _self - the target URL will be opened in the same frame as it was
clicked
- _parent - the target URL will be opened in the parent frameset
- _top - the target URL will be opened in the full body of the
window
|
Standard Attributes
| id, class, title, style, dir, lang, xml:lang, tabindex,
accesskey |
For a full description, go to Standard
Attributes.
Event Attributes
| onclick, ondblclick, onmousedown, onmouseup, onmouseover,
onmousemove, onmouseout, onkeypress, onkeydown, onkeyup, onfocus, onblur |
For a full description, go to Event Attributes.
Example
| Source |
Output |
| <p>Click on the dog:</p>
<img src ="dog.gif"
width="180" height="120"
alt="Dog"
usemap ="#dogmap" >
<map id ="dogmap"
name="dogmap">
<area shape ="rect" coords ="40,28,148,106"
href ="dog.htm" target ="_blank"
alt="Dog" />
</map> |
Click on the dog:
|
|
|