frames.html
html-spec/specifications/prose/html-4.01/present/frames.html · 1214 line(s) · html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Frames in HTML documents</title>
<link rel="previous" href="graphics.html">
<link rel="next" href="../interact/forms.html">
<link rel="contents" href="../cover.html#toc">
<link rel="stylesheet" type="text/css" href=
"http://www.w3.org/StyleSheets/TR/W3C-REC">
<link rel="STYLESHEET" href="../style/default.css" type="text/css">
</head>
<body>
<div class="navbar" align="center"> <a href="graphics.html">previous</a>
<a href="../interact/forms.html">next</a> <a href=
"../cover.html#minitoc">contents</a> <a href="../index/elements.html">
elements</a> <a href="../index/attributes.html">attributes</a> <a
href="../index/list.html">index</a>
<hr></div>
<h1 align="center"><a name="h-16">16</a> Frames</h1>
<div class="subtoc">
<p><strong>Contents</strong></p>
<ol>
<li><a class="tocxref" href="#h-16.1">Introduction to frames</a></li>
<li><a class="tocxref" href="#h-16.2">Layout of frames</a>
<ol>
<li><a class="tocxref" href="#h-16.2.1">The <samp class="einst2">
FRAMESET</samp> element</a>
<ul>
<li><a class="tocxref" href="#h-16.2.1.1">Rows and columns</a></li>
<li><a class="tocxref" href="#h-16.2.1.2">Nested frame sets</a></li>
<li><a class="tocxref" href="#h-16.2.1.3">Sharing data among frames</a></li>
</ul>
</li>
<li><a class="tocxref" href="#h-16.2.2">The <samp class="einst2">FRAME</samp>
element</a>
<ul>
<li><a class="tocxref" href="#h-16.2.2.1">Setting the initial contents of a
frame</a></li>
<li><a class="tocxref" href="#h-16.2.2.2">Visual rendering of a frame</a></li>
</ul>
</li>
</ol>
</li>
<li><a class="tocxref" href="#h-16.3">Specifying target frame information</a>
<ol>
<li><a class="tocxref" href="#h-16.3.1">Setting the default target for
links</a></li>
<li><a class="tocxref" href="#h-16.3.2">Target semantics</a></li>
</ol>
</li>
<li><a class="tocxref" href="#h-16.4">Alternate content</a>
<ol>
<li><a class="tocxref" href="#h-16.4.1">The <samp class="einst2">
NOFRAMES</samp> element</a></li>
<li><a class="tocxref" href="#h-16.4.2">Long descriptions of frames</a></li>
</ol>
</li>
<li><a class="tocxref" href="#h-16.5">Inline frames: the <samp class="einst2">
IFRAME</samp> element</a></li>
</ol>
</div>
<h2><a name="h-16.1">16.1</a> <span class="index-inst" title=
"frame::introduction to"><a name="idx-frame">Introduction to
frames</a></span></h2>
<p>HTML frames allow authors to present documents in multiple views, which may
be independent windows or subwindows. Multiple views offer designers a way to
keep certain information visible, while other views are scrolled or replaced.
For example, within the same window, one frame might display a static banner, a
second a navigation menu, and a third the main document that can be scrolled
through or replaced by navigating in the second frame.</p>
<div class="example">
<p>Here is a simple frame document:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A simple frameset document</TITLE>
</HEAD>
<FRAMESET cols="20%, 80%">
<FRAMESET rows="100, 200">
<FRAME src="contents_of_frame1.html">
<FRAME src="contents_of_frame2.gif">
</FRAMESET>
<FRAME src="contents_of_frame3.html">
<NOFRAMES>
<P>This frameset document contains:
<UL>
<LI><A href="contents_of_frame1.html">Some neat contents</A>
<LI><IMG src="contents_of_frame2.gif" alt="A neat image">
<LI><A href="contents_of_frame3.html">Some other neat contents</A>
</UL>
</NOFRAMES>
</FRAMESET>
</HTML>
</pre>
<p>that might create a frame layout something like this:</p>
<pre>
---------------------------------------
| | |
| | |
| Frame 1 | |
| | |
| | |
|---------| |
| | Frame 3 |
| | |
| | |
| | |
| Frame 2 | |
| | |
| | |
| | |
| | |
---------------------------------------
</pre>
</div>
<p>If the user agent can't display frames or is configured not to, it will
render the contents of the <a href="frames.html#edef-NOFRAMES" class="noxref">
<samp class="einst">NOFRAMES</samp></a> element.</p>
<h2><a name="h-16.2">16.2</a> Layout of frames</h2>
<p>An HTML document that describes frame layout (called a <span class=
"index-def" title="frameset document"><a name="didx-frameset_document"><dfn>
frameset document</dfn></a></span>) has a different makeup than an HTML
document without frames. A standard document has one <a href=
"../struct/global.html#edef-HEAD" class="noxref"><samp class="einst">
HEAD</samp></a> section and one <a href="../struct/global.html#edef-BODY"
class="noxref"><samp class="einst">BODY</samp></a>. A frameset document has a
<a href="../struct/global.html#edef-HEAD" class="noxref"><samp class="einst">
HEAD</samp></a>, and a <a href="frames.html#edef-FRAMESET" class="noxref"><samp
class="einst">FRAMESET</samp></a> in place of the <a href=
"../struct/global.html#edef-BODY" class="noxref"><samp class="einst">
BODY</samp></a>.</p>
<p>The <a href="frames.html#edef-FRAMESET" class="noxref"><samp class="einst">
FRAMESET</samp></a> section of a document specifies the layout of views in the
main user agent window. In addition, the <a href="frames.html#edef-FRAMESET"
class="noxref"><samp class="einst">FRAMESET</samp></a> section can contain a <a
href="frames.html#edef-NOFRAMES" class="noxref"><samp class="einst">
NOFRAMES</samp></a> element to provide <a href="#alternate">alternate
content</a> for user agents that do not support frames or are configured not to
display frames.</p>
<p>Elements that might normally be placed in the <a href=
"../struct/global.html#edef-BODY" class="noxref"><samp class="einst">
BODY</samp></a> element must not appear before the first <a href=
"frames.html#edef-FRAMESET" class="noxref"><samp class="einst">
FRAMESET</samp></a> element or the <a href="frames.html#edef-FRAMESET" class=
"noxref"><samp class="einst">FRAMESET</samp></a> will be ignored.</p>
<h3><a name="h-16.2.1">16.2.1</a> The <a name="edef-FRAMESET"><samp class=
"edef">FRAMESET</samp></a> element</h3>
<div class="dtd-fragment">
<pre class="dtd-fragment">
<![ <a href="../sgml/loosedtd.html#HTML.Frameset">%HTML.Frameset;</a> [
<!<a name="frameset">ELEMENT</a> <a href="frames.html#edef-FRAMESET" class=
"noxref"><samp class=
"einst">FRAMESET</samp></a> - - ((FRAMESET|FRAME)+ & NOFRAMES?) -- window subdivision-->
<!ATTLIST FRAMESET
<a href=
"../sgml/loosedtd.html#coreattrs">%coreattrs;</a> -- <a
href="../struct/global.html#adef-id">id</a>, <a href=
"../struct/global.html#adef-class">class</a>, <a href=
"styles.html#adef-style">style</a>, <a href=
"../struct/global.html#adef-title">title</a> --
<a href="frames.html#adef-rows-FRAMESET" class="noxref"><samp class=
"ainst-FRAMESET">rows</samp></a> <a href=
"../sgml/loosedtd.html#MultiLengths">%MultiLengths;</a> #IMPLIED -- list of lengths,
default: 100% (1 row) --
<a href="frames.html#adef-cols-FRAMESET" class="noxref"><samp class=
"ainst-FRAMESET">cols</samp></a> <a href=
"../sgml/loosedtd.html#MultiLengths">%MultiLengths;</a> #IMPLIED -- list of lengths,
default: 100% (1 col) --
<a href="../interact/scripts.html#adef-onload" class="noxref"><samp class=
"ainst-FRAMESET">onload</samp></a> <a href=
"../sgml/loosedtd.html#Script">%Script;</a> #IMPLIED -- all the frames have been loaded --
<a href="../interact/scripts.html#adef-onunload" class="noxref"><samp class=
"ainst-FRAMESET">onunload</samp></a> <a href=
"../sgml/loosedtd.html#Script">%Script;</a> #IMPLIED -- all the frames have been removed --
>
]]>
</pre>
</div>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-rows-FRAMESET"><samp class="adef">rows</samp></a> = <a href=
"../types.html#type-multi-length"><em>multi-length-list</em></a> <a href=
"../types.html#case-neutral">[CN]</a></dt>
<dd>This attribute specifies the layout of horizontal frames. It is a
comma-separated list of pixels, percentages, and relative lengths. The default
value is 100%, meaning one row.</dd>
<dt><a name="adef-cols-FRAMESET"><samp class="adef">cols</samp></a> = <a href=
"../types.html#type-multi-length"><em>multi-length-list</em></a> <a href=
"../types.html#case-neutral">[CN]</a></dt>
<dd>This attribute specifies the layout of vertical frames. It is a
comma-separated list of pixels, percentages, and relative lengths. The default
value is 100%, meaning one column.</dd>
</dl>
</div>
<div class="aref-list">
<p><em>Attributes defined elsewhere</em></p>
<ul>
<li><a href="../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a>, <a href="../struct/global.html#adef-class" class="noxref"><samp
class="ainst">class</samp></a> (<a href=
"../struct/global.html#id-and-class">document-wide identifiers</a>)</li>
<li><a href="../struct/global.html#adef-title" class="noxref"><samp class=
"ainst">title</samp></a> (<a href="../struct/global.html#title">element
title</a>)</li>
<li><a href="styles.html#adef-style" class="noxref"><samp class="ainst">
style</samp></a> (<a href="../present/styles.html#style-element">inline style
information</a>)</li>
<li><a href="../interact/scripts.html#adef-onload" class="noxref"><samp class=
"ainst">onload</samp></a>, <a href="../interact/scripts.html#adef-onunload"
class="noxref"><samp class="ainst">onunload</samp></a> (<a href=
"../interact/scripts.html#events">intrinsic events</a>)</li>
</ul>
</div>
<p><span class="index-inst" title="frameset::specifying layout of">The <a name=
"idx-frameset" href="frames.html#edef-FRAMESET" class="noxref"><samp class=
"einst">FRAMESET</samp></a> element specifies the layout of the main user
window in terms of rectangular subspaces.</span></p>
<h4>Rows and columns<a name="h-16.2.1.1"> </a></h4>
<p>Setting the <a href="frames.html#adef-rows-FRAMESET" class="noxref"><samp
class="ainst-FRAMESET">rows</samp></a> attribute defines the number of
horizontal subspaces in a frameset. Setting the <a href=
"frames.html#adef-cols-FRAMESET" class="noxref"><samp class="ainst-FRAMESET">
cols</samp></a> attribute defines the number of vertical subspaces. Both
attributes may be set simultaneously to create a grid.</p>
<p>If the <a href="frames.html#adef-rows-FRAMESET" class="noxref"><samp class=
"ainst-FRAMESET">rows</samp></a> attribute is not set, each column extends the
entire length of the page. If the <a href="frames.html#adef-cols-FRAMESET"
class="noxref"><samp class="ainst-FRAMESET">cols</samp></a> attribute is not
set, each row extends the entire width of the page. If neither attribute is
set, the frame takes up exactly the size of the page.</p>
<p>Frames are created left-to-right for columns and top-to-bottom for rows.
When both attributes are specified, views are created left-to-right in the top
row, left-to-right in the second row, etc.</p>
<div class="example">
<p>The first example divides the screen vertically in two (i.e., creates a top
half and a bottom half).</p>
<pre>
<FRAMESET rows="50%, 50%">
<em>...the rest of the definition...</em>
</FRAMESET>
</pre>
<p>The next example creates three columns: the second has a fixed width of 250
pixels (useful, for example, to hold an image with a known size). The first
receives 25% of the remaining space and the third 75% of the remaining
space.</p>
<pre>
<FRAMESET cols="1*,250,3*">
<em>...the rest of the definition...</em>
</FRAMESET>
</pre>
<p>The next example creates a 2x3 grid of subspaces.</p>
<pre>
<FRAMESET rows="30%,70%" cols="33%,34%,33%">
<em>...the rest of the definition...</em>
</FRAMESET>
</pre>
<p>For the next example, suppose the browser window is currently 1000 pixels
high. The first view is allotted 30% of the total height (300 pixels). The
second view is specified to be exactly 400 pixels high. This leaves 300 pixels
to be divided between the other two frames. The fourth frame's height is
specified as "2*", so it is twice as high as the third frame, whose height is
only "*" (equivalent to 1*). Therefore the third frame will be 100 pixels high
and the fourth will be 200 pixels high.</p>
<pre>
<FRAMESET rows="30%,400,*,2*">
<em>...the rest of the definition...</em>
</FRAMESET>
</pre>
</div>
<p>Absolute lengths that do not sum to 100% of the real available space should
be adjusted by the user agent. When underspecified, remaining space should be
allotted proportionally to each view. When overspecified, each view should be
reduced according to its specified proportion of the total space.</p>
<h4><span class="index-inst" title="frameset::nested"><a name="idx-frameset-1">
Nested frame sets</a></span><a name="h-16.2.1.2"> </a></h4>
<p>Framesets may be nested to any level.</p>
<div class="example">
<p>In the following example, the outer <a href="frames.html#edef-FRAMESET"
class="noxref"><samp class="einst">FRAMESET</samp></a> divides the available
space into three equal columns. The inner <a href="frames.html#edef-FRAMESET"
class="noxref"><samp class="einst">FRAMESET</samp></a> then divides the second
area into two rows of unequal height.</p>
<pre>
<FRAMESET cols="33%, 33%, 34%">
<em>...contents of first frame...</em>
<FRAMESET rows="40%, 50%">
<em>...contents of second frame, first row...</em>
<em>...contents of second frame, second row...</em>
</FRAMESET>
<em>...contents of third frame...</em>
</FRAMESET>
</pre>
</div>
<h4><span class="index-inst" title="object::in HEAD|frameset::sharing data
among"><a name="sharing-frame-data">Sharing data among frames</a></span><a
name="h-16.2.1.3"> </a></h4>
<p>Authors may share data among several frames by including this data via an <a
href="../struct/objects.html#edef-OBJECT" class="noxref"><samp class="einst">
OBJECT</samp></a> element. Authors should include the <a href=
"../struct/objects.html#edef-OBJECT" class="noxref"><samp class="einst">
OBJECT</samp></a> element in the <a href="../struct/global.html#edef-HEAD"
class="noxref"><samp class="einst">HEAD</samp></a> element of a frameset
document and name it with the <a href="../struct/global.html#adef-id" class=
"noxref"><samp class="ainst">id</samp></a> attribute. Any document that is the
contents of a frame in the frameset may refer to this identifier.</p>
<div class="example">
<p>The following example illustrates how a script might refer to an <a href=
"../struct/objects.html#edef-OBJECT" class="noxref"><samp class="einst">
OBJECT</samp></a> element defined for an entire frameset:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>This is a frameset with OBJECT in the HEAD</TITLE>
<!-- This OBJECT is not rendered! -->
<OBJECT id="myobject" data="data.bar"></OBJECT>
</HEAD>
<FRAMESET>
<FRAME src="bianca.html" name="bianca">
</FRAMESET>
</HTML>
<!-- In bianca.html -->
<HTML>
<HEAD>
<TITLE>Bianca's page</TITLE>
</HEAD>
<BODY>
<em>...the beginning of the document...</em>
<P>
<SCRIPT type="text/javascript">
parent.myobject.myproperty
</SCRIPT>
<em>...the rest of the document...</em>
</BODY>
</HTML>
</pre>
</div>
<h3><a name="h-16.2.2">16.2.2</a> The <a name="edef-FRAME"><samp class="edef">
FRAME</samp></a> element</h3>
<div class="dtd-fragment">
<pre class="dtd-fragment">
<![ <a href="../sgml/loosedtd.html#HTML.Frameset">%HTML.Frameset;</a> [
<!-- reserved frame names start with "_" otherwise starts with letter -->
<!<a name="frame">ELEMENT</a> <a href="frames.html#edef-FRAME" class=
"noxref"><samp class=
"einst">FRAME</samp></a> - O EMPTY -- subwindow -->
<!ATTLIST FRAME
<a href=
"../sgml/loosedtd.html#coreattrs">%coreattrs;</a> -- <a
href="../struct/global.html#adef-id">id</a>, <a href=
"../struct/global.html#adef-class">class</a>, <a href=
"styles.html#adef-style">style</a>, <a href=
"../struct/global.html#adef-title">title</a> --
<a href="frames.html#adef-longdesc-FRAME" class="noxref"><samp class=
"ainst-FRAME">longdesc</samp></a> <a href=
"../sgml/loosedtd.html#URI">%URI;</a> #IMPLIED -- link to long description
(complements title) --
<a href="frames.html#adef-name-FRAME" class="noxref"><samp class=
"ainst-FRAME">name</samp></a> <a href=
"../types.html#type-cdata">CDATA</a> #IMPLIED -- name of frame for targetting --
<a href="frames.html#adef-src-FRAME" class="noxref"><samp class=
"ainst-FRAME">src</samp></a> <a href=
"../sgml/loosedtd.html#URI">%URI;</a> #IMPLIED -- source of frame content --
<a href="frames.html#adef-frameborder" class="noxref"><samp class=
"ainst-FRAME">frameborder</samp></a> (1|0) 1 -- request frame borders? --
<a href="frames.html#adef-marginwidth" class="noxref"><samp class=
"ainst-FRAME">marginwidth</samp></a> <a href=
"../sgml/loosedtd.html#Pixels">%Pixels;</a> #IMPLIED -- margin widths in pixels --
<a href="frames.html#adef-marginheight" class="noxref"><samp class=
"ainst-FRAME">marginheight</samp></a> <a href=
"../sgml/loosedtd.html#Pixels">%Pixels;</a> #IMPLIED -- margin height in pixels --
<a href="frames.html#adef-noresize" class="noxref"><samp class=
"ainst-FRAME">noresize</samp></a> (noresize) #IMPLIED -- allow users to resize frames? --
<a href="frames.html#adef-scrolling" class="noxref"><samp class=
"ainst-FRAME">scrolling</samp></a> (yes|no|auto) auto -- scrollbar or none --
>
]]>
</pre>
</div>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-name-FRAME"><samp class="adef">name</samp></a> = <a href=
"../types.html#type-cdata"><em>cdata</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd>This attribute assigns a name to the current frame. This name may be used
as the target of subsequent links.</dd>
<dt><a name="adef-longdesc-FRAME"><samp>longdesc</samp></a> = <a href=
"../types.html#type-uri"><em>uri</em></a> <a href=
"../types.html#see-type-for-case">[CT]</a></dt>
<dd>This attribute specifies a link to a long description of the frame. This
description should supplement the short description provided using the <a href=
"../struct/global.html#adef-title" class="noxref"><samp class="ainst">
title</samp></a> attribute, and may be particularly useful for non-visual user
agents.</dd>
<dt><a name="adef-src-FRAME"><samp class="adef">src</samp></a> = <a href=
"../types.html#type-uri"><em>uri</em></a> <a href=
"../types.html#see-type-for-case">[CT]</a></dt>
<dd>This attribute specifies the location of the initial contents to be
contained in the frame.</dd>
<dt><a name="adef-noresize"><samp class="adef">noresize</samp></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd>When present, this boolean attribute tells the user agent that the frame
window must not be resizeable.</dd>
<dt><a name="adef-scrolling"><samp class="adef">scrolling</samp></a> = <samp>
auto|yes|no</samp> <a href="../types.html#case-insensitive">[CI]</a></dt>
<dd>This attribute specifies scroll information for the frame window. Possible
values
<ul>
<li><samp>auto:</samp> This value tells the user agent to provide scrolling
devices for the frame window when necessary. This is the default value.</li>
<li><samp>yes:</samp> This value tells the user agent to always provide
scrolling devices for the frame window.</li>
<li><samp>no:</samp> This value tells the user agent not to provide scrolling
devices for the frame window.</li>
</ul>
</dd>
<dt><a name="adef-frameborder"><samp class="adef">frameborder</samp></a> =
<samp>1|0</samp> <a href="../types.html#case-neutral">[CN]</a></dt>
<dd><span class="index-inst" title="border::around a frame|frame::border of"><a
name="idx-border">This attribute</a></span> provides the user agent with
information about the frame border. Possible values:
<ul>
<li><samp>1:</samp> This value tells the user agent to draw a separator between
this frame and every adjoining frame. This is the default value.</li>
<li><samp>0:</samp> This value tells the user agent not to draw a separator
between this frame and every adjoining frame. Note that separators may be drawn
next to this frame nonetheless if specified by other frames.</li>
</ul>
</dd>
<dt><a name="adef-marginwidth"><samp class="adef">marginwidth</samp></a> = <a
href="../types.html#type-pixels"><em>pixels</em></a> <a href=
"../types.html#case-neutral">[CN]</a></dt>
<dd><span class="index-inst" title="white space::around frame|frame::white
space around"><a name="idx-white_space">This attribute</a></span> specifies the
amount of space to be left between the frame's contents in its left and right
margins. The value must be greater than zero (pixels). The default value
depends on the user agent.</dd>
<dt><a name="adef-marginheight"><samp class="adef">marginheight</samp></a> = <a
href="../types.html#type-pixels"><em>pixels</em></a> <a href=
"../types.html#case-neutral">[CN]</a></dt>
<dd>This attribute specifies the amount of space to be left between the frame's
contents in its top and bottom margins. The value must be greater than zero
(pixels). The default value depends on the user agent.</dd>
</dl>
</div>
<div class="aref-list">
<p><em>Attributes defined elsewhere</em></p>
<ul>
<li><a href="../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a>, <a href="../struct/global.html#adef-class" class="noxref"><samp
class="ainst">class</samp></a> (<a href=
"../struct/global.html#id-and-class">document-wide identifiers</a>)</li>
<li><a href="../struct/global.html#adef-title" class="noxref"><samp class=
"ainst">title</samp></a> (<a href="../struct/global.html#title">element
title</a>)</li>
<li><a href="styles.html#adef-style" class="noxref"><samp class="ainst">
style</samp></a> (<a href="../present/styles.html#style-element">inline style
information</a>)</li>
</ul>
</div>
<p>The <a href="frames.html#edef-FRAME" class="noxref"><samp class="einst">
FRAME</samp></a> element defines the contents and appearance of a single
frame.</p>
<h4><span class="index-inst" title="frame::initial contents of"><a name=
"idx-frame-3">Setting the initial contents of a frame</a></span><a name=
"h-16.2.2.1"> </a></h4>
<p>The <a href="../interact/forms.html#adef-src" class="noxref"><samp class=
"ainst">src</samp></a> attribute specifies the initial document the frame will
contain.</p>
<div class="example">
<p>The following example HTML document:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A frameset document</TITLE>
</HEAD>
<FRAMESET cols="33%,33%,33%">
<FRAMESET rows="*,200">
<FRAME src="contents_of_frame1.html">
<FRAME src="contents_of_frame2.gif">
</FRAMESET>
<FRAME src="contents_of_frame3.html">
<FRAME src="contents_of_frame4.html">
</FRAMESET>
</HTML>
</pre>
<p>should create a frame layout something like this:</p>
<pre>
------------------------------------------
|Frame 1 |Frame 3 |Frame 4 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
-------------| | |
|Frame 2 | | |
| | | |
| | | |
------------------------------------------
</pre>
<p>and cause the user agent to load each file into a separate view.</p>
</div>
<p>The contents of a frame must not be in the same document as the frame's
definition.</p>
<div class="illegal-example">
<p><span class="example-title">ILLEGAL EXAMPLE:</span>
<br>
The following frameset definition is not legal HTML since the contents of the
second frame are in the same document as the frameset.</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A frameset document</TITLE>
</HEAD>
<FRAMESET cols="50%,50%">
<FRAME src="contents_of_frame1.html">
<FRAME src="#anchor_in_same_document">
<NOFRAMES>
<em>...some text...</em>
<H2><A name="anchor_in_same_document">Important section</A></H2>
<em>...some text...</em>
</NOFRAMES>
</FRAMESET>
</HTML>
</pre>
</div>
<h4>Visual rendering of a frame<a name="h-16.2.2.2"> </a></h4>
<div class="example">
<p>The following example illustrates the usage of the decorative <a href=
"frames.html#edef-FRAME" class="noxref"><samp class="einst">FRAME</samp></a>
attributes. We specify that frame 1 will allow no scroll bars. Frame 2 will
leave white space around its contents (initially, an image file) and the frame
will not be resizeable. No border will be drawn between frames 3 and 4. Borders
will be drawn (by default) between frames 1, 2, and 3.</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A frameset document</TITLE>
</HEAD>
<FRAMESET cols="33%,33%,33%">
<FRAMESET rows="*,200">
<FRAME src="contents_of_frame1.html" scrolling="no">
<FRAME src="contents_of_frame2.gif"
marginwidth="10" marginheight="15"
noresize>
</FRAMESET>
<FRAME src="contents_of_frame3.html" frameborder="0">
<FRAME src="contents_of_frame4.html" frameborder="0">
</FRAMESET>
</HTML>
</pre>
</div>
<h2><a name="h-16.3">16.3</a> <span class="index-inst" title="frame::target of
document|target frame::specification of"><a name="target-info">Specifying
target frame information</a></span></h2>
<div class="note">
<p><em><strong>Note.</strong> For information about current practice in
determining the target of a frame, please consult the <a href=
"../appendix/notes.html#notes-frames">notes on frames</a> in the
appendix.</em></p>
</div>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-target"><samp class="adef">target</samp></a> = <a href=
"../types.html#type-frame-target"><em>frame-target</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd>This attribute specifies the name of a frame where a document is to be
opened.</dd>
</dl>
</div>
By assigning a name to a frame via the <a href="frames.html#adef-name-FRAME"
class="noxref"><samp class="ainst-FRAME">name</samp></a> attribute, authors can
refer to it as the "target" of links defined by other elements. The <a href=
"frames.html#adef-target" class="noxref"><samp class="ainst">target</samp></a>
attribute may be set for elements that create links (<a href=
"../struct/links.html#edef-A" class="noxref"><samp class="einst">A</samp></a>,
<a href="../struct/links.html#edef-LINK" class="noxref"><samp class="einst">
LINK</samp></a>), image maps (<a href="../struct/objects.html#edef-AREA" class=
"noxref"><samp class="einst">AREA</samp></a>), and forms (<a href=
"../interact/forms.html#edef-FORM" class="noxref"><samp class=
"einst">FORM</samp></a>).
<p>Please consult the section on <a href="../types.html#type-frame-target">
target frame names</a> for information about recognized frame names.</p>
<div class="example">
<p>This example illustrates how targets allow the dynamic modification of a
frame's contents. First we define a frameset in the document <tt>
frameset.html</tt>, shown here:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A frameset document</TITLE>
</HEAD>
<FRAMESET rows="50%,50%">
<FRAME name="fixed" src="init_fixed.html">
<FRAME name="dynamic" src="init_dynamic.html">
</FRAMESET>
</HTML>
</pre>
<p>Then, in <tt>init_dynamic.html</tt>, we link to the frame named
"dynamic".</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>A document with anchors with specific targets</TITLE>
</HEAD>
<BODY>
<em>...beginning of the document...</em>
<P>Now you may advance to
<A href="slide2.html" target="dynamic">slide 2.</A>
<em>...more document...</em>
<P>You're doing great. Now on to
<A href="slide3.html" target="dynamic">slide 3.</A>
</BODY>
</HTML>
</pre>
<p>Activating either link opens a new document in the frame named "dynamic"
while the other frame, "fixed", maintains its initial contents.</p>
</div>
<div class="note">
<p><span class="index-inst" title="frame::URI problems with"><a name=
"idx-frame-5"><em><strong>Note.</strong> A frameset definition never changes,
but the contents of one of its frames can. Once the initial contents of a frame
change, the frameset definition no longer reflects the current state of its
frames.</em></a></span></p>
<p><em>There is currently no way to encode the entire state of a frameset in a
URI. Therefore, many user agents do not allow users to assign a bookmark to a
frameset.</em></p>
<p><span class="index-inst" title="frameset::navigation problems with"><a name=
"idx-frameset-3"><em>Framesets may make navigation forward and backward through
your user agent's history more difficult for users.</em></a></span></p>
</div>
<h3><a name="h-16.3.1">16.3.1</a> <span class="index-inst" title="target
frame::default|default::target frame|link::default target for"><a name=
"idx-target_frame-1">Setting the default target for links</a></span></h3>
<p>When many links in the same document designate the same target, it is
possible to specify the target once and dispense with the <a href=
"frames.html#adef-target" class="noxref"><samp class="ainst">target</samp></a>
attribute of each element. This is done by setting the <a href=
"frames.html#adef-target" class="noxref"><samp class="ainst">target</samp></a>
attribute of the <a href="../struct/links.html#edef-BASE" class="noxref"><samp
class="einst">BASE</samp></a> element.</p>
<div class="example">
<p>We return to the previous example, this time factoring the target
information by defining it in the <a href="../struct/links.html#edef-BASE"
class="noxref"><samp class="einst">BASE</samp></a> element and removing it from
the <a href="../struct/links.html#edef-A" class="noxref"><samp class="einst">
A</samp></a> elements.</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>A document with BASE with a specific target</TITLE>
<BASE href="http://www.mycom.com/Slides" target="dynamic">
</HEAD>
<BODY>
<em>...beginning of the document...</em>
<P>Now you may advance to <A href="slide2.html">slide 2.</A>
<em>...more document...</em>
<P>You're doing great. Now on to
<A href="slide3.html">slide 3.</A>
</BODY>
</HTML>
</pre>
</div>
<h3><a name="h-16.3.2">16.3.2</a> <span class="index-inst" title="target
frame::semantics of|link::semantics with target frame"><a name=
"idx-target_frame-2">Target semantics</a></span></h3>
<p>User agents should determine the target frame in which to load a linked
resource according to the following precedences (highest priority to
lowest):</p>
<ol>
<li>If an element has its <a href="frames.html#adef-target" class="noxref">
<samp class="ainst">target</samp></a> attribute set to a known frame, when the
element is activated (i.e., a link is followed or a form is processed), the
resource designated by the element should be loaded into the target frame.</li>
<li>If an element does not have the <a href="frames.html#adef-target" class=
"noxref"><samp class="ainst">target</samp></a> attribute set but the <a href=
"../struct/links.html#edef-BASE" class="noxref"><samp class="einst">
BASE</samp></a> element does, the <a href="../struct/links.html#edef-BASE"
class="noxref"><samp class="einst">BASE</samp></a> element's <a href=
"frames.html#adef-target" class="noxref"><samp class="ainst">target</samp></a>
attribute determines the frame.</li>
<li>If neither the element nor the <a href="../struct/links.html#edef-BASE"
class="noxref"><samp class="einst">BASE</samp></a> element refers to a target,
the resource designated by the element should be loaded into the frame
containing the element.</li>
<li>If any <a href="frames.html#adef-target" class="noxref"><samp class=
"ainst">target</samp></a> attribute refers to an unknown frame <tt>F</tt>, the
user agent should create a new window and frame, assign the name <tt>F</tt> to
the frame, and load the resource designated by the element in the new
frame.</li>
</ol>
<p>User agents may provide users with a mechanism to override the <a href=
"frames.html#adef-target" class="noxref"><samp class="ainst">target</samp></a>
attribute.</p>
<h2><a name="h-16.4">16.4</a> <span class="index-inst" title=
"frameset::alternate content for|accessibility::and alternate frame content"><a
name="alternate">Alternate content</a></span></h2>
<p>Authors should supply alternate content for those user agents that do not
support frames or are configured not to display frames.</p>
<h3><a name="h-16.4.1">16.4.1</a> The <a name="edef-NOFRAMES"><samp class=
"edef">NOFRAMES</samp></a> element</h3>
<div class="dtd-fragment">
<pre class="dtd-fragment">
<![ <a href="../sgml/loosedtd.html#HTML.Frameset">%HTML.Frameset;</a> [
<!ENTITY % noframes.content "(BODY) -(NOFRAMES)">
]]>
<!ENTITY % noframes.content "(<a href=
"../sgml/loosedtd.html#flow">%flow;</a>)*">
<!<a name="noframes">ELEMENT</a> <a href="frames.html#edef-NOFRAMES" class=
"noxref"><samp class="einst">NOFRAMES</samp></a> - - <a href=
"../sgml/loosedtd.html#noframes.content">%noframes.content;</a>
-- alternate content container for non frame-based rendering -->
<!ATTLIST NOFRAMES
<a href=
"../sgml/loosedtd.html#attrs">%attrs;</a> -- <a
href="../sgml/loosedtd.html#coreattrs">%coreattrs</a>, <a href=
"../sgml/loosedtd.html#i18n">%i18n</a>, <a href=
"../sgml/loosedtd.html#events">%events</a> --
>
</pre>
</div>
<div class="aref-list">
<p><em>Attributes defined elsewhere</em></p>
<ul>
<li><a href="../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a>, <a href="../struct/global.html#adef-class" class="noxref"><samp
class="ainst">class</samp></a> (<a href=
"../struct/global.html#id-and-class">document-wide identifiers</a>)</li>
<li><a href="../struct/dirlang.html#adef-lang" class="noxref"><samp class=
"ainst">lang</samp></a> (<a href=
"../struct/dirlang.html#language-info">language information</a>), <a href=
"../struct/dirlang.html#adef-dir" class="noxref"><samp class="ainst">
dir</samp></a> (<a href="../struct/dirlang.html#bidirection">text
direction</a>)</li>
<li><a href="../struct/global.html#adef-title" class="noxref"><samp class=
"ainst">title</samp></a> (<a href="../struct/global.html#title">element
title</a>)</li>
<li><a href="styles.html#adef-style" class="noxref"><samp class="ainst">
style</samp></a> (<a href="../present/styles.html#style-element">inline style
information</a>)</li>
<li><a href="../interact/scripts.html#adef-onclick" class="noxref"><samp class=
"ainst">onclick</samp></a>, <a href="../interact/scripts.html#adef-ondblclick"
class="noxref"><samp class="ainst">ondblclick</samp></a>, <a href=
"../interact/scripts.html#adef-onmousedown" class="noxref"><samp class="ainst">
onmousedown</samp></a>, <a href="../interact/scripts.html#adef-onmouseup"
class="noxref"><samp class="ainst">onmouseup</samp></a>, <a href=
"../interact/scripts.html#adef-onmouseover" class="noxref"><samp class="ainst">
onmouseover</samp></a>, <a href="../interact/scripts.html#adef-onmousemove"
class="noxref"><samp class="ainst">onmousemove</samp></a>, <a href=
"../interact/scripts.html#adef-onmouseout" class="noxref"><samp class="ainst">
onmouseout</samp></a>, <a href="../interact/scripts.html#adef-onkeypress"
class="noxref"><samp class="ainst">onkeypress</samp></a>, <a href=
"../interact/scripts.html#adef-onkeydown" class="noxref"><samp class="ainst">
onkeydown</samp></a>, <a href="../interact/scripts.html#adef-onkeyup" class=
"noxref"><samp class="ainst">onkeyup</samp></a> (<a href=
"../interact/scripts.html#events">intrinsic events</a>)</li>
</ul>
</div>
<p>The <a href="frames.html#edef-NOFRAMES" class="noxref"><samp class="einst">
NOFRAMES</samp></a> element specifies content that should be displayed only by
user agents that do not support frames or are configured not to display frames.
User agents that support frames must only display the contents of a <a href=
"frames.html#edef-NOFRAMES" class="noxref"><samp class="einst">
NOFRAMES</samp></a> declaration when configured not to display frames. User
agents that do not support frames must display the contents of <a href=
"frames.html#edef-NOFRAMES" class="noxref"><samp class="einst">
NOFRAMES</samp></a> in any case.</p>
<p>The <a href="frames.html#edef-NOFRAMES" class="noxref"><samp class="einst">
NOFRAMES</samp></a> element is part of both the <a href=
"../struct/global.html#version-info">transitional and frameset DTDs.</a> In a
document that uses the frameset DTD, <a href="frames.html#edef-NOFRAMES" class=
"noxref"><samp class="einst">NOFRAMES</samp></a> <span class="index-inst"
title="frameset::use of NOFRAMES in"><a name="idx-frameset-5">may be
used</a></span> at the end of the FRAMESET section of the document.</p>
<div class="example">
<p>For example:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A frameset document with NOFRAMES</TITLE>
</HEAD>
<FRAMESET cols="50%, 50%">
<FRAME src="main.html">
<FRAME src="table_of_contents.html">
<NOFRAMES>
<P>Here is the <A href="main-noframes.html">
non-frame based version of the document.</A>
</NOFRAMES>
</FRAMESET>
</HTML>
</pre>
</div>
<p><a href="frames.html#edef-NOFRAMES" class="noxref"><samp class="einst">
NOFRAMES</samp></a> may be used, for example, in a document that is the source
of a frame and that uses the transitional DTD. This allows authors to explain
the document's purpose in cases when it is viewed out of the frameset or with a
user agent that doesn't support frames.</p>
<h3><a name="h-16.4.2">16.4.2</a> <span class="index-inst" title=
"accessibility::and long frame descriptions|frame::long description
of|image::not directly in frame"><a name="idx-accessibility-1">Long
descriptions of frames</a></span></h3>
<p>The <a href="frames.html#adef-longdesc-FRAME" class="noxref"><samp class=
"ainst-FRAME">longdesc</samp></a> attribute allows authors to make frame
documents more accessible to people using non-visual user agents. This
attribute designates a resource that provides a long description of the frame.
Authors should note that long descriptions associated with frames are attached
to the <em>frame</em>, not the frame's contents. Since the contents may vary
over time, the initial long description is likely to become inappropriate for
the frame's later contents. In particular, authors should not include an image
as the sole content of a frame.</p>
<div class="example">
<p>The following frameset document describes two frames. The left frame
contains a table of contents and the right frame initially contains an image of
an ostrich:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A poorly-designed frameset document</TITLE>
</HEAD>
<FRAMESET cols="20%, 80%">
<FRAME src="table_of_contents.html">
<FRAME src="ostrich.gif" longdesc="ostrich-desc.html">
</FRAMESET>
</HTML>
</pre>
<p>Note that the image has been included in the frame independently of any HTML
element, so the author has no means of specifying alternate text other than via
the <a href="frames.html#adef-longdesc-FRAME" class="noxref"><samp class=
"ainst-FRAME">longdesc</samp></a> attribute. If the contents of the right frame
change (e.g., the user selects a rattlesnake from the table of contents), users
will have no textual access to the frame's new content.</p>
<p>Thus, authors should not put an image directly in a frame. Instead, the
image should be specified in a separate HTML document, and therein annotated
with the appropriate alternate text:</p>
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A well-designed frameset document</TITLE>
</HEAD>
<FRAMESET cols="20%, 80%">
<FRAME src="table_of_contents.html">
<FRAME src="ostrich-container.html">
</FRAMESET>
</HTML>
</pre>
<pre>
<!-- In ostrich-container.html: -->
<HTML>
<HEAD>
<TITLE>The fast and powerful ostrich</TITLE>
</HEAD>
<P>
<OBJECT data="ostrich.gif" type="image/gif">
These ostriches sure taste good!
</OBJECT>
</HTML>
</pre>
</div>
<h2><a name="h-16.5">16.5</a> <span class="index-inst" title=
"frame::inline|document::ways to include"><a name="idx-frame-7">Inline
frames:</a></span> the <a name="edef-IFRAME"><samp class="edef">
IFRAME</samp></a> element</h2>
<div class="dtd-fragment">
<pre class="dtd-fragment">
<!<a name="iframe">ELEMENT</a> <a href="frames.html#edef-IFRAME" class=
"noxref"><samp class="einst">IFRAME</samp></a> - - (<a href=
"../sgml/loosedtd.html#flow">%flow;</a>)* -- inline subwindow -->
<!ATTLIST IFRAME
<a href=
"../sgml/loosedtd.html#coreattrs">%coreattrs;</a> -- <a
href="../struct/global.html#adef-id">id</a>, <a href=
"../struct/global.html#adef-class">class</a>, <a href=
"styles.html#adef-style">style</a>, <a href=
"../struct/global.html#adef-title">title</a> --
<a href="frames.html#adef-longdesc-FRAME" class="noxref"><samp class=
"ainst-FRAME">longdesc</samp></a> <a href=
"../sgml/loosedtd.html#URI">%URI;</a> #IMPLIED -- link to long description
(complements title) --
<a href="frames.html#adef-name-IFRAME" class="noxref"><samp class=
"ainst-IFRAME">name</samp></a> <a href=
"../types.html#type-cdata">CDATA</a> #IMPLIED -- name of frame for targetting --
<a href="../interact/forms.html#adef-src" class="noxref"><samp class=
"ainst-IFRAME">src</samp></a> <a href=
"../sgml/loosedtd.html#URI">%URI;</a> #IMPLIED -- source of frame content --
<a href="frames.html#adef-frameborder" class="noxref"><samp class=
"ainst-IFRAME">frameborder</samp></a> (1|0) 1 -- request frame borders? --
<a href="frames.html#adef-marginwidth" class="noxref"><samp class=
"ainst-IFRAME">marginwidth</samp></a> <a href=
"../sgml/loosedtd.html#Pixels">%Pixels;</a> #IMPLIED -- margin widths in pixels --
<a href="frames.html#adef-marginheight" class="noxref"><samp class=
"ainst-IFRAME">marginheight</samp></a> <a href=
"../sgml/loosedtd.html#Pixels">%Pixels;</a> #IMPLIED -- margin height in pixels --
<a href="frames.html#adef-scrolling" class="noxref"><samp class=
"ainst-IFRAME">scrolling</samp></a> (yes|no|auto) auto -- scrollbar or none --
<a href="graphics.html#adef-align" class="noxref"><samp class=
"ainst-IFRAME">align</samp></a> <a href=
"../sgml/loosedtd.html#IAlign">%IAlign;</a> #IMPLIED -- vertical or horizontal alignment --
<a href="frames.html#adef-height-IFRAME" class="noxref"><samp class=
"ainst-IFRAME">height</samp></a> <a href=
"../sgml/loosedtd.html#Length">%Length;</a> #IMPLIED -- frame height --
<a href="frames.html#adef-width-IFRAME" class="noxref"><samp class=
"ainst-IFRAME">width</samp></a> <a href=
"../sgml/loosedtd.html#Length">%Length;</a> #IMPLIED -- frame width --
>
</pre>
</div>
<div class="adef-list">
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-longdesc-IFRAME"><samp>longdesc</samp></a> = <a href=
"../types.html#type-uri"><em>uri</em></a> <a href=
"../types.html#see-type-for-case">[CT]</a></dt>
<dd>This attribute specifies a link to a long description of the frame. This
description should supplement the short description provided using the <a href=
"../struct/global.html#adef-title" class="noxref"><samp class="ainst">
title</samp></a> attribute, and is particularly useful for non-visual user
agents.</dd>
<dt><a name="adef-name-IFRAME"><samp class="adef">name</samp></a> = <a href=
"../types.html#type-cdata"><em>cdata</em></a> <a href=
"../types.html#case-insensitive">[CI]</a></dt>
<dd>This attribute assigns a name to the current frame. This name may be used
as the target of subsequent links.</dd>
<dt><a name="adef-width-IFRAME"><samp class="adef">width</samp></a> = <a href=
"../types.html#type-length"><em>length</em></a> <a href=
"../types.html#case-neutral">[CN]</a></dt>
<dd>The width of the inline frame.</dd>
<dt><a name="adef-height-IFRAME"><samp class="adef">height</samp></a> = <a
href="../types.html#type-length"><em>length</em></a> <a href=
"../types.html#case-neutral">[CN]</a></dt>
<dd>The height of the inline frame.</dd>
</dl>
</div>
<div class="aref-list">
<p><em>Attributes defined elsewhere</em></p>
<ul>
<li><a href="../struct/global.html#adef-id" class="noxref"><samp class="ainst">
id</samp></a>, <a href="../struct/global.html#adef-class" class="noxref"><samp
class="ainst">class</samp></a> (<a href=
"../struct/global.html#id-and-class">document-wide identifiers</a>)</li>
<li><a href="../struct/global.html#adef-title" class="noxref"><samp class=
"ainst">title</samp></a> (<a href="../struct/global.html#title">element
title</a>)</li>
<li><a href="styles.html#adef-style" class="noxref"><samp class="ainst">
style</samp></a> (<a href="../present/styles.html#style-element">inline style
information</a>)</li>
<li><a href="frames.html#adef-name-FRAME" class="noxref"><samp class=
"ainst-FRAME">name</samp></a>, <a href="frames.html#adef-src-FRAME" class=
"noxref"><samp class="ainst-FRAME">src</samp></a>, <a href=
"frames.html#adef-frameborder" class="noxref"><samp class="ainst-FRAME">
frameborder</samp></a>, <a href="frames.html#adef-marginwidth" class="noxref">
<samp class="ainst-FRAME">marginwidth</samp></a>, <a href=
"frames.html#adef-marginheight" class="noxref"><samp class="ainst-FRAME">
marginheight</samp></a>, <a href="frames.html#adef-scrolling" class="noxref">
<samp class="ainst-FRAME">scrolling</samp></a> (<a href="#edef-FRAME">frame
controls and decoration</a>)</li>
<li><a href="graphics.html#adef-align" class="noxref"><samp class="ainst">
align</samp></a> (<a href="graphics.html#alignment">alignment</a>)</li>
</ul>
</div>
The <a href="frames.html#edef-IFRAME" class="noxref"><samp class="einst">
IFRAME</samp></a> element allows authors to insert a frame within a block of
text. Inserting an inline frame within a section of text is much like inserting
an object via the <a href="../struct/objects.html#edef-OBJECT" class="noxref">
<samp class="einst">OBJECT</samp></a> element: they both allow you to insert an
HTML document in the middle of another, they may both be aligned with
surrounding text, etc.
<p>The information to be inserted inline is designated by the <a href=
"../interact/forms.html#adef-src" class="noxref"><samp class="ainst-IFRAME">
src</samp></a> attribute of this element. The <em>contents</em> of the <a href=
"frames.html#edef-IFRAME" class="noxref"><samp class="einst">IFRAME</samp></a>
element, on the other hand, should only be displayed by user agents that do not
support frames or are configured not to display frames.</p>
<div class="example">
<p>For user agents that support frames, the following example will place an
inline frame surrounded by a border in the middle of the text.</p>
<pre>
<IFRAME src="foo.html" width="400" height="500"
scrolling="auto" frameborder="1">
[Your user agent does not support frames or is currently configured
not to display frames. However, you may visit
<A href="foo.html">the related document.</A>]
</IFRAME>
</pre>
</div>
<p>Inline frames may not be resized (and thus, they do not take the <a href=
"frames.html#adef-noresize" class="noxref"><samp class="ainst">
noresize</samp></a> attribute).</p>
<div class="note">
<p><em><strong>Note.</strong> HTML documents may also be embedded in other HTML
documents with the <a href="../struct/objects.html#edef-OBJECT" class="noxref">
<samp class="einst">OBJECT</samp></a> element. See the section on <a href=
"../struct/objects.html#embedded-documents">embedded documents</a> for
details.</em></p>
</div>
<div class="navbar" align="center">
<hr><a href="graphics.html">previous</a> <a href=
"../interact/forms.html">next</a> <a href="../cover.html#minitoc">
contents</a> <a href="../index/elements.html">elements</a> <a
href="../index/attributes.html">attributes</a> <a href=
"../index/list.html">index</a></div>
</body>
</html>