FRAMESET - Setting up a row/column of frames

Appearance: <FRAMESET ROWS="*,*,*"|COLS="*,*,*"> </FRAMESET>
Attributes: ROWS="list"|COLS="list", BORDER=n, FRAMEBORDER=n, FRAMESPACING=n
Contents: FRAME, FRAMESET, NOFRAMES.
May occur in: HTML, FRAMESET.

The FRAMESET element is used to set up a row or column of frames, documents which appear together, each in a separate frame. The ROWS and COLS attributes are used to set up a row or column. Their syntax is identical, the only difference is that with ROWS a series of row of frames is defined, and with COLS a series of columns.

Both use as value a comma-separated list of widths for each row or column. This value can be expressed in pixels, as a percentage of the total available space for the frameset, or as a relative size using the special "*" value. This value can be preceded by a number to increase its relative weight. Space for frames specified using "*" is allocated after the pixel and percentage widths/heights have been evaluated. If two or more frames are specified with "*" as value, the remaining size will be equally divided up between them. For example, "*,3*" would give the first frame one quarter of the available space, and the second frame three quarters.

If the total requested size does not match the available space, the browser will adjust (normalize) the size. If a pixel width is used, then it is strongly recommended that at least one window is given a relative value or the asterisk, so the browser can adjust the windows for the currently available space.

This element is used as a replacement for the BODY element. Thus, it appears in a document directly after the HEAD element.

The source document for each window is specified with a FRAME element.

Here is an example, which demonstrates how to define a three-column frame:

<HTML>
<HEAD>
<TITLE>Hello world</TITLE>
</HEAD>
<FRAMESET COLS="20%,60%,20%">
<FRAME SRC="left.html">
<FRAME SRC="middle.html">
<FRAME SRC="right.html">
</FRAMESET>
</HTML>

Nesting frames

It is possible to create combinations of rows and columns in a frame. This is done by putting additional FRAMESET elements inside the current FRAMESET, with the appropriate attributes. A source document specified by a FRAME element can also contain a FRAMESET, which will be loaded in the window defined for that document.

It is also possible to load a frameset document inside a frame, this frameset will then be displayed in that frame. In this case, the hierarchy is different: the "_parent" reserved frame name now points to this frameset and can be used in the framed frameset to update this frame.

The only two elements permitted inside FRAMESET are FRAME and NOFRAMES. The latter is used to give users whose browser does not support frames a "traditional" HTML document. Frameset documents do not have any content when viewed with a browser which does not support frames. The FRAME and FRAMESET elements are treated as unknown tags and skipped, and since there is no BODY in the document there is nothing to render.

Table of contentsTerminologyBasicsGlossary ]


Web Design Group
Last updated: 14 Dec 1996
Copyright © 1996 Arnoud "Galactus" Engelfriet.
E-mail: galactus@htmlhelp.com.