HTML » Tags » frameset

Version: 4.0

Compability: Explorer 4, 5 Netscape 4, 6

Syntax:
<frameset> ... </frameset>

The <frameset> tag serves as a container element to hold a collection of frames. This tag determines the number of frames, whether the frames are to be of a column or of a row configuration, and sets the spacing for either case. In fact, you must specify either a column or row configuration using either the rows or cols attribute (but not both).

When you are using the framset tag, you absolutely must not use a body tag. The frameset tag is used in place of the body tag. However, you can use the iframe tag to create inline frames within a body element.

The only tags that are valid inside the frameset tag are the frame, frameset, head, and noframe. Note that you can nest frameset tags inside of frameset tags. Therefore, an HTML document can contain numerous frames. This opens the possibility of creating complex and imaginative page displays (however, always remember to keep the page user friendly).

The closing tag is mandatory.

Examples

Code:
<html>
<head>
<title>frames example</title>
</head>
<frameset cols="50%, 50%">
   <noframes>
      To be viewed properly, this page requires frames.
   </noframes>
   <frameset rows="33%, 33%, *">
      <frame src="html_frames_red.html">
      <frame src="html_frames_orange.html">
      <frame src="html_frames_yellow.html">
   </frameset>
   <frameset rows="50%, 50%">
      <frame src="html_frames_green.html">
      <frame src="html_frames_blue.html">
   </frameset>
</frameset>
</html>
Explanation:

This example creates five frames, each with a different background color.

Language(s): HTML

See Also: