13.10 Serving Dynamic Content with Inline Frames^521
The code for the inline frame used to create this effect is as follows:
<iframe src="trillium.html" title="Trillium Wild Flower"
height="160" name="flower" width="350">
Description of the lovely Spring wild flower, the
<a href="trillium.html" target="_blank">Trillium</a></iframe>
As shown, an inline frame is created using the <iframe>element. The <iframe>element
is a container tag. It is always used with its closing </iframe>tag. Any content that
should be displayed if the browser does not support inline frames (such as a text descrip-
tion or link to the actual page) should be placed between the tags. The <iframe>tag con-
figures an area on a Web page that can be used to display a different Web page document.
This inline area is 150 pixels high and 300 pixels wide by default. The height and width
attributes can be used to configure the exact dimensions. In the example code, the align
attribute was used to align the inline frame to the right of the text on the Web page. The
nameattribute was used so that the inline frame could be targeted by links. Table 13.2
lists attributes for <iframe>tags. Commonly used attributes are shown in bold.
Table 13.2
Attribute Values Purpose
align right, center, left(default) Specifies the horizontal alignment of the inline frame
(deprecated—use CSS instead)
frameborder 0 indicates no visible borders
1 indicates borders display (default)
Determines whether borders should be displayed
around this inline frame
height Number of pixels or percentage Gives height of the inline frame
id Alphanumeric, no spaces; the value
must be unique and not used for other id
values on the same XHTML document
Provides a unique identifier for the inline frame
longdesc Provides a detailed text description of
the frame; may be accessed by assistive
technologies
Gives URL of Web page with detailed description of
the contents of the inline frame
marginheight Number of pixels Configures the top and bottom margins of the inline
frame
marginwidth Number of pixels Configures the width of the right and left margins of
an inline frame
name Alphanumeric, no spaces, begin with a
letter
Configures the name of the inline frame; required
when using the target attribute to configure hyperlinks
(deprecated in XHTML but is used to provide back-
ward compatibility with browsers that support HTML)
scrolling yesindicates that scrollbars are always
present; noindicates that scrollbars are
never displayed; autoindicates that
scrollbars appear when needed (default)
Determines whether scrollbars will appear if the
document displayed is larger than the size of the
inline frame
src Valid file name of a Web page document
(required)
Configures the name of the file to be displayed in the
inline frame
title Text phrase that describes the inline
frame
Configures the title of the inline frame; can be
accessed by screen readers and is recommended by
the W3C to improve accessibility
width Number of pixels or percentage Specifies width of the inline frame