You are here:  NetStrider » Tutorials » HTMLRef » Frames » FRAMESET «
<FRAMESET> Command

Command Syntax:

<FRAMESET command parameters></FRAMESET>

Defines and contains a Framed HTML Document Segment in an HTML document consisting entirely and only of a frameset.  A single frameset can define either columns or rows.  To define both columns and rows within a framed document it is necessary to have at least two framesets, one defining the columns and one defining the rows.

Only <FRAME> and other <FRAMESET> elements are permitted with a frameset.

The frameset replaces the <BODY> HTML Document Segment and must be defined immediately following the <HEAD> HTML Document Segment.

See also:  <FRAME>, <IFRAME>, <NOFRAMES>

Primary Command Parameters:

cols="pixels | % | *"

Defines the number and dimension of the columns within a frameset.  The number of columns within the frameset is determined by the number of dimensions specified in the comma-delimited list.  Column width can be defined using absolute pixels, a percent of the space available or the asterisk wildcard *.

Examples:

    cols="50,50,*"

    Defines three columns.  The first two columns would both be 50 pixels wide and the third column would occupy the remaining available display width.

    cols="25%,75%"

    Defines two columns.  The first column would occupy 25% of the available display width and the second column 75% of the available display width.

    cols="33%,*,33%"

    Defines three columns.  The first and third columns would occupy 33% of the available display width and the center column would occupy the remainder of the available width.


rows="pixels | % | *"

Defines the number and dimension of the rows within a frameset.  The number of rows within the frameset is determined by the number of dimensions specified in the comma-delimited list.  Row height can be defined using absolute pixels, a percent of the space available or the asterisk wildcard *.

Examples:

    rows="200,100,*"

    Defines three rows.  The first row would be 200 pixels high and the second row 100 pixels high.  The third row would occupy the remaining available display height.

    rows="50%,50%"

    Defines two rows.  Both rows would occupy exactly 50% of the available display height.

    rows="25%,*,25%"

    Defines three rows.  The first and third rows would occupy 25% of the available display height and the center row would occupy the remainder of the available display height.

Secondary Command Parameters:
border="pixels"

Allows a global value to be set on the width, in pixels, of all borders surrounding defined frames within a frameset.

bordercolor="named color | color value"

Allows a global value to be set on the color, using either Netscape named colors or hexadecimal color values.

frameborder="yes | no"

Allows frame borders on all defined frames within a frameset to be turned on or off.  The default is on - yes.

Example:
Code very like this defines the frameset for this document: <frameset rows="100,*"> <frameset cols="50%,50%"> <frame src="banner1.html" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/banner1.html" name="banner1"> <frame src="banner2.html" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/banner2.html" name="banner2"> </frameset> <frameset cols="25%,75%"> <frame src="toc.html" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/toc.html" name="toc"> <frame src="javascript:if(confirm('http://www.netstrider.com/tutorials/HTMLRef/frames/intro.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found. \n\nDo you want to open it from the server?'))window.location='http://www.netstrider.com/tutorials/HTMLRef/frames/intro.html'" tppabs="http://www.netstrider.com/tutorials/HTMLRef/frames/intro.html" name="display"> </frameset> </frameset> Note that it contains three <FRAMESET> command elements and that two secondary framesets are nested within the primary frameset.  Proper nesting of elements is the key to successful frames coding.

The frameset elements set up the rows and columns for the display of the framed document.  The primary frameset sets up two rows.  The secondary framesets set up the columns within each row independently of one another.

The innermost nested <FRAME> elements define the location of the HTML code that will be loaded into and displayed in each of the four independent frames.

Return to Section E:H


HTML Reference Guide Table of Contents.
Author: Randy D. Ralph.  In place February 23, 1999.  Copyright © 1999 NetStrider.  Presented as a public service.




Hosted by uCoz