This element represents the meta structure of a document using frames.
By replacing the BODY element in the document structure, the FRAMESET
element defines the document layout in terms of areas of the screen
containing sub-document URLs (the frame content.)
Each FRAMESET element can consist of a ROWS attribute, a COLS attribute,
or both. The ROWS attribute indicates that the sub-area is to be divided
in to horizontal document "stripes", while the COLS attribute
defines vertical display areas. Using both attributes in a single FRAMESET
creates a grid of sub document areas.
If no ROWS or COLS attributes are present in a FRAMESET element, it is
interpreted as a single row arbitrarily sized to fit the current window.
If BOTH ROWS and COLS have been specified, sub-document definitions
are distributed left-to-right, top-to-bottom of the frame layout. Nested
FRAMESET structures occur in place of where a corresponding FRAME definition
statement would appear.
Note: The * character used below
in the ROWS and COLS attributes deserves some explanation, as its use in
this situation is unique in HTML. By itself, the *
character specifies that any remaining frame width be devoted to the current
frame. If there are multiple frames in the ROWS/COLS specification that have the
* character, remaining space will be divided
evenly between them. If the * character is
preceded by an integer (N), that frame will
receive N times as much of the remaining relative
sized space as it would without the N prefix.
Description:
When this attribute is used in the FRAMESET tag, it attempts to set the
colors of all borders for all frames in the frameset. This can be
overridden on a frame-by-frame basis in the FRAME tag.
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute specifies that the current window will be sub-divided
into columns (vertical bands of framed content.) Values to this attribute
are separated by commas, and represent the horizontal widths of the
resultant separate child frames in the current parent frameset. In theory,
all values listed should account for, or sum up to, the full parent frame
size. It is possible to abuse this, because the three types of values
can be freely intermixed.
Values:CDATA.
[Specified in pixels, a percentage of parent frame width
(%) or in a dynamic relative sizing attribute specified
by the use of the * character.]
Description:
This attribute gives the author the option of whether or not to have
borders around all the frames in the FRAMESET. This value can
be overridden locally at the FRAME level.
Values:
Internet Explorer lists values of
1 [DEFAULT] and
0 [display no border.]
Netscape lists values
for this attribute as Yes [DEFAULT] and
No, but also understands "1"/"0".
Description:
This attribute specifies the name of the link so that scripting languages
may access it.
Values:
An alphanumeric string. Must begin with an alphabetic character.
Rows
[2|3|3.2|4]
[X1|X1.1]
[IE3A1|M3B2|N2|O2.1]
Standards Details:
In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute specifies that the current window will be sub-divided
into rows (horizontal bands of framed content.) Values to this
attribute are separated by commas, and represent the vertical height
of the resultant separate child frames in the current parent frameset.
In theory, all values listed should account for, or sum up to, the full
parent frame size. It is possible to abuse this, because the three
types of values can be freely intermixed.
Values:CDATA.
[Specified in pixels, a percentage of parent frame
height (%) or in a dynamic relative sizing attribute
specified by the use of the * character.]
Example
<html>
<head>
<title>Frames
Example</title>
</head>
<framesetrows="20,25%,*">
<framesrc="frame1.html"
name="frame1" />
<framesrc="frame2.html"
name="frame2" />
<framesetcols="30%,*">
<framesrc="frame3.html"
name="frame3" />
<framesrc="frame4.html"
name="frame4" />
</frameset>
<noframes>
<body>
This text
will appear only if the browser does not support frames.
</body>
</noframes>
</frameset>
</html>
There are many readers out there who do not like frames.
Keep this in mind when authoring your pages.
Good situations to use frames: Elements that the User Should Always See.
Things such as control bars, copyright notices, and title graphics can be
placed in a static, individual frame. Table of Contents.
One frame can contain an index that, when clicked, displays results in an
adjoining frame. Question and Answer.
Frames design allows queries to be posed and answered on the same page, with
one frame holding the query form, and the other presenting the results.
It is STRONGLY recommended to include alternate body content
in the NOFRAMES section of a frames definition document. Even if the content
is a link to a non-framed version of the page, this provides users of frames
incapable browsers the chance to view the content of your site.
[Test]
It is easy to abuse any of the methods of specifying frame sizes to allow
dimensions that are not equal to the parent frame size (while this can
be harmless, it could cause display problems.)
A Frequently Asked Question about Frames authoring: How do I cause a hyperlink to update multiple
frames?
It is possible to do with just HTML, but it can become complex very quickly.
If you need to update multiple frames, define the group of multiple frames
that you want to update simultaneously as a single frame. The URL of that
frame will be yet ANOTHER frameset. When it comes time to do an action that
will affect multiple frames, call the action with the TARGET being the FRAME
NAME for the group. This update will probably need to call another
destination URL that is also a FRAMESET definition page. Note: This works
easiest when the multiple frames that need updating are adjacent or easily
defined by a single FRAMESET tag. This method does NOT work as well
for pages that need to update multiple times.
Browser Peculiarities
Support Note: An attempt was made in the beta versions
of Mosaic V. 3.0 to support frames capability, but it was retracted
for the PC final release version.
[Test]
None of the Internet Explorer or Netscape versions allow recursive references
to parent documents.
Anecdote: A security hole was found in early Netscape implementations
where an author could specify a fairly invisible 1 pixel frame that could
keep track of all sites the user visited.
Internet Explorer seems to be much more stringent in parsing correct
frames document syntax. If your documents work fine under Netscape, it
won't hurt to re-check the behavior under Internet Explorer.
Netscape uses the BORDER attribute to control the frame border size
while Internet Explorer uses the FRAMESPACING attribute to control the
same behavior. It should be safe to use both of these attributes at the
same time to ensure proper display on both of these browsers.
[Test]
In all versions of Netscape, if no SRC attribute is initially specified,
the frame area is no longer addressable as a target (even if a NAME is
specified) for document links, etc. Internet Explorer and Opera handle
the case of an initial blank SRC just fine.
[Test]
Authors can also choose to specify ROWS and COLS in the same FRAMESET
element. If this is done, the nested FRAME references will be assigned
sequentially to the ROWS and COLS layout specifications as follows:
left to right, top to bottom (eg: COLS, then ROWS.)
IE/Netscape Compatibility: If you are trying to
create content that flows seamlessly across frames in IE and Netscape,
check out this document
for some tips.
[Test]
Internet Explorer: If the FRAMESPACING attribute is given a value of
zero, it effectively sets the NORESIZE attribute of the sub-frames as
well. It almost seems as if IE frames need a positive FRAMESPACING
value for the user to "grab on to" or move.
Internet Explorer versions before 5.5 Beta 1 implemented frames by creating new
instances of IE. The greater the number of frames, the greater the number
of active IE "browser copies" there were. This was not the most efficient
of methods. Beginning in IE v5.5 Beta 1 frames are now implemented using
a single browser control, which Microsoft states will improve overall
frame performance.
CSS: Before IE v5.5 Beta 1, FRAMEs and IFRAMEs could not use the 'z-index'
property (they would always be on the "top" of the rendering surface and
nothing could be placed "above" them) and could not be transparent (such
that content from positioned content beneath would "shine through".)
Beginning in IE v5.5 Beta 1, these capabilities now exist.
Netscape 6 and CSS: Even though support for the %Core% attributes is
listed here, in direct testing it seemed that VERY few
CSS properties could successfully be applied to this element. Keep this
in mind in your authoring.