HTML XHTML The Complete Reference
home » reference » appendix a » html element reference

<frameset> (Frameset Definition)


This element is used to define the organization of a set of independent window regions known as frames as defined by the <frame> element. This element replaces the <body> element in framing documents.

Syntax (Transitional Only)


<frameset
class="class name(s)"
cols="list of columns"
id="unique alphanumeric identifier"
rows="list of rows"
style="style information"
title="advisory text"

</frameset>

Attributes Defined by Internet Explorer


border="pixels" (4)
bordercolor="color name | #RRGGBB" (4)
frameborder="no | yes | 0 | 1" (4)
framespacing="pixels" (4)
lang="language code" (4)
language="javascript | jscript | vbs | vbscript" (4)
hidefocus="true | false" (5.5)
tabindex="number" (5.5)
unselectable="on | off" (5.5)

Standard Events


onload, onunload

Events Defined by Internet Explorer


onactivate, onafterprint, onbeforedeactivate, onbeforeprint, onbeforeunload, onblur, oncontrolselect, ondeactivate, onfocus, onmove, onmoveend, onmovestart, onresizeend, onresizestart

Element Specific Attributes


border
This attribute sets the width in pixels of frame borders within the frame set. Setting border="0" eliminates all frame borders. This attribute is not defined in the HTML specification but is widely supported.

bordercolor
This attribute sets the color for frame borders within the frame set using either a named color or a color specified in the hexadecimal #RRGGBB format.

cols
This attribute contains a comma-delimited list, which specifies the number and size of columns contained within a set of frames. List items indicate columns from left to right. Column size is specified in three formats, which might be mixed. A column can be assigned a fixed width in pixels. It also can be assigned a percentage of the available width, such as 50 percent. Finally, a column can be set to expand to fill the available space by setting the value to *, which acts as a wildcard.

frameborder
This attribute controls whether or not frame borders should be displayed. Netscape supports no and yes values. Microsoft uses 1 and 0 as well as no and yes.

framespacing
This attribute indicates the space between frames in pixels.

rows
This attribute contains a comma-delimited list, which specifies the number and size of rows contained within a set of frames. The number of entries in the list indicates the number of rows. Row size is specified with the same formats used for columns.

Examples


<!-- This example defines a frame set of three columns. The middle column is 50 pixels wide. The first and last columns fill the remaining space. The last column takes twice as much space as the first. -->

<frameset cols="*,50,*">
   <frame src="column1.htm">
   <frame src="column2.htm">
   <frame src="column3.htm">
</frameset>


<!-- This example defines a frame set of two columns, one of which is 20% of the screen, and the other, 80%. -->

<frameset cols="20%, 80%">
   <frame src="controls.htm">
   <frame src="display.htm">
</frameset>


<!-- This example defines two rows, one of which is 10% of the screen, and the other, whatever space is left. -->
<frameset rows="10%, *">
   <frame src="adbanner.htm" name="ad_frame">
   <frame src="contents.htm" name="content_frame">
</frameset>

Compatibility


HTML 4 and 4.01 (frameset DTD), XHTML 1.0 (frameset DTD)
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 2, 3, 4, 4.5-4.8, 6, 7
Opera 4-7

Notes


The content model says that the <frameset> tag contains one or more <frame> tags, which are used to indicate the framed contents. A <frameset> tag also might contain a <noframes> tag whose contents will be displayed by browsers that do not support frames.

The <frameset> element replaces the <body> element in a framing document as shown here:

<html>
<head>
<title>
Collection of Frames</title>
</head>


<frameset cols="*,50,*">
   <frame src="column1.htm" name="col1">
   <frame src="column2.htm" name="col2">
   <frame src="column3.htm" name="col3">

<noframes>
Please visit our <a href"noframes.htm">no frames</a> site.
</frameset>

</html>

(X)HTML Elements
CSS Properties
Previous: frame Next: h1-h6
< Home | About | Chapters | Examples | Errata | Reference | Site Map >