HTML and CSS Reference
In-Depth Information
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
name attribute 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 <iframe> tag attributes
Attribute
Values
Purpose
right, center, left (default)
Specifies the horizontal alignment of the inline frame
(deprecated—use CSS instead)
align
0 indicates no visible borders
1 indicates borders display (default)
Determines whether borders should be displayed
around this inline frame
frameborder
Number of pixels or percentage
Gives height of the inline frame
height
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
id
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
longdesc
marginheight Number of pixels
Configures the top and bottom margins of the inline
frame
Number of pixels
Configures the width of the right and left margins of
an inline frame
marginwidth
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)
yes indicates that scrollbars are always
present; no indicates that scrollbars are
never displayed; auto indicates that
scrollbars appear when needed (default)
Determines whether scrollbars will appear if the
document displayed is larger than the size of the
inline frame
scrolling
Valid file name of a Web page document
(required)
Configures the name of the file to be displayed in the
inline frame
src
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
title
Number of pixels or percentage
Specifies width of the inline frame
width
 
Search WWH ::




Custom Search