HTML » Tags » frameset

Version: 4.0

Compability: Explorer 4, 5 Netscape 4, 6

<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.


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

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

Language(s): HTML

See Also: