Little Web Hut

HTML 4.01 and XHTML 1.0 Reference: <frameset> Tag

The <frameset> tag is allowed in DTD Frameset documents but not Transitional or Strict documents.
HTML <frameset> Tag
Syntax This element uses separate opening and closing tags.
<frameset>...</frameset>
Usage The <frameset> tag can be used to divide the display into multiple frames. Each of the separate frames can display its own web page. The <frame> tag is used to specify the URL of the web page that will be displayed in a frame. One <frame> tag is used for each URL.

For a typical HTML document, the contents of the body section are displayed using a browser. In a frameset document, the <frameset> tag replaces the <body> tag. Therefore, a frameset document generally does not have content that will be displayed. Instead it specifies how content, from multiple other sources, will be displayed and it specifies the sources of the content. There is an exception where a frameset document does have content that will be displayed. The exception is when the <noframes> tag is used. The content between the opening and closing <noframes> tags will be displayed in the event that the browser does not support frames.

HTML <frameset> tag example.
<html>

<head>
 <title>HTML Test</title>
</head>

<frameset cols="40%,60%">
 <frame src="../html/div_tag/" title="sample frame">
 <frame src="../html/span_tag/" title="sample frame">
</frameset>
<noframes></noframes>

</html>
Test It HTML Style

XHTML <frameset> tag example.
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
 <title>HTML Test</title>
</head>

<frameset cols="40%,60%">
 <frame src="../html/div_tag/" title="sample frame" />
 <frame src="../html/span_tag/" title="sample frame" />
</frameset>
<noframes></noframes>

</html>
Test It XHTML Style

Content Model The <frameset> element can contain the following tags between its opening and closing tags.

<frameset> Tag Attribute Summary
Required Tag Specific Core Focus Events Language
  cols onload onunload rows id class style title      

<frameset> Tag Attributes
Attribute Description
colsThe cols attribute specifies the number of columns and the width of each column. The value for this attribute is a comma separated list of widths. Each value in the list can be in pixels, a percentage (number followed by %), or a relative value of the remaining space (integer followed by *). When using a relative value, "*" is the same as "1*".

HTML <frameset> tag example using the cols attribute.
<frameset cols="100,30%,*">
 <frame src="../html/form_tag/" title="sample frame">
 <frame src="../html/div_tag/" title="sample frame">
 <frame src="../html/span_tag/" title="sample frame">
</frameset>
<noframes></noframes>
Test It HTML Style

XHTML <frameset> tag example using the cols attribute.
<frameset cols="100,30%,*">
 <frame src="../html/form_tag/" title="sample frame" />
 <frame src="../html/div_tag/" title="sample frame" />
 <frame src="../html/span_tag/" title="sample frame" />
</frameset>
<noframes></noframes>
Test It XHTML Style

onloadThe onload attribute is used to specify a script to be be run when the frames have been loaded.
onunloadThe onunload attribute is used to specify a script to be be run when the web page has been removed.
rowsThe rows attribute specifies the number of rows and the height of each row. The value for this attribute is a comma separated list of heights. Each value in the list can be in pixels, a percentage (number followed by %), or a relative value of the remaining space (integer followed by *). When using a relative value, "*" is the same as "1*".

HTML <frameset> tag example using the rows attribute.
<frameset rows="80,30%,*">
 <frame src="../html/form_tag/" title="sample frame">
 <frame src="../html/div_tag/" title="sample frame">
 <frame src="../html/span_tag/" title="sample frame">
</frameset>
<noframes></noframes>
Test It HTML Style

XHTML <frameset> tag example using the rows attribute.
<frameset rows="80,30%,*">
 <frame src="../html/form_tag/" title="sample frame" />
 <frame src="../html/div_tag/" title="sample frame" />
 <frame src="../html/span_tag/" title="sample frame" />
</frameset>
<noframes></noframes>
Test It XHTML Style

idThe id attribute assigns a unique name to a tag. This allows style sheets or scripts to reference the tag. See id Example
classThe class attribute assigns a class name to a tag. The class name does not need to be unique. More than one tag can have the same class name. This allows style sheets or scripts to reference multiple tags with a single class name. See class Example
styleThe style attribute specifies styles for the tag. For Cascading Style Sheets (CSS), the syntax is name:value. Each name:value pair is separated by semicolons. See style Example
titleThe title attribute specifies additional information about the tag. It is common for browsers to display the title when the pointing device stops over the object. See title Example

HTML <frameset> Tag Examples
Test It HTML StyleTest It HTML Style<frameset> tag example.
Test It HTML StyleTest It HTML Style<frameset> tag example using the cols attribute.
Test It HTML StyleTest It HTML Style<frameset> tag example using the rows attribute.