Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1
A.10 Graphic Tags^591

The <map>Ta g
<map></map>
The <map>tag is a container tag that identifies the beginning and the end of an image
map. The nameattribute is used to associate the <map>tag with its corresponding
<img />tag. The <img />tag is configured with the usemapattribute to indicate
which map to use. Table A.15 shows <map>tag attributes and their values.

The <area />Ta g
<area />
The self-contained <area />tag configures a hyperlink on an image map. Table A.16
shows <area />tag attributes and their values.

Table A.15tag attributes


Attribute Value Usage
id Text name, alphanumeric, begin-
ning with a letter, no spaces

Identifies the map. This value is used by the corresponding
<img />tag. The value must be unique and not used for
other idvalues on the same XHTML document.
name Text name, alphanumeric, begin-
ning with a letter, no spaces

Identifies the map. This value is used by the corresponding
<img />tag. This is deprecated in XHTML but is included for
backward compatibility.

Table A.16tag attributes


Attribute Value Usage
alt A brief text description of the portion of
the image

Provides accessibility to visitors unable to view the
image.
coords Numeric pixels; see Table A.17 Configures the coordinates of the clickable image area.
href URL or Web page document name Configures the Web page that will display when the
area is clicked.
shape "rect"indicates rectangle Configures the shape of the area.
"circle"indicates circle
"poly"indicates polygon

Table A.14tag attributes (continued)


Attribute Value Usage
usemap The text name of an image map Corresponds to the name value on the associated
<map>tag.
vspace Number of pixels Configures space above and below the image.
(Deprecated)
width Number of pixels Configures the width of the image.

Each shape has a different syntax used to list the coordinates (coords) of the hyperlink
area. See Table A.17.
Free download pdf