Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1

(^590) Appendix A XHTML Reference


A.10 Graphic Tags


The <img />Ta g
<img src="image.gif" />
The self-contained <img />tag, called the image tag, displays an image file. Table A.14
shows <img />tag attributes and their values.

Table A.13targetattribute values


targetAttribute Value Result
"_top" Typically used to bust out of a frameset and display the hyperlinked page in
the entire browser window.
"_blank" Opens a new browser window to display the hyperlinked page.
"_parent" Displays the hyperlinked page in the frame that contains the current frameset.
"_self" Displays the hyperlinked page in the same window.
A valid frame name value configured
in a frameset page

Displays the hyperlinked page in the named window.

Table A.14tag attributes


Attribute Value Usage
align "left"(default), "right", "top",
"texttop", "middle", "absmiddle",
"bottom"

Aligns the image relative to the text on the page.
(Deprecated)

alt A brief text description of the image Provides accessibility to visitors unable to view the
image.
border Number of pixels for image border; "0"
prevents the border from being displayed

Configures the border area on the image. (Deprecated)

height Number of pixels Configures the height of the image.
hspace Number of pixels Configures space to the left and right of the image.
(Deprecated)
.id Text name, alphanumeric, beginning with a
letter, no spaces

Identifies the image. The value must be unique and not
used for other idvalues on the same XHTML
document.
longdesc URL of Web page with detailed description
of the image

Used by some assistive technologies to provide acces-
sibility to the information in the image.
name Text name, alphanumeric, beginning with a
letter, no spaces

Names the image so that it can be easily accessed by
client-side scripting languages such as JavaScript. This
attribute is deprecated in XHTML but is used to provide
backward compatibility with browsers that support
HTML.
src Name of the image file (required) Configures the image file to be displayed.
title A brief text description Configures a text description that will display when the
visitor moves the mouse pointer over the image.
Free download pdf