HTML <frameset> tag

The <frameset> tag is used to create a frameset. A frameset contains two or more frames which are displayed using the <frame> tag. Each frame will contain a separate page.

NOTE: The <frameset> tag and the other frame tags (<frame>, <noframes>) should only be used with a Frameset document type.

Attributes

Attribute Description Possible values
cols Set how many columns in a frameset and their sizes sizeInPixels, sizeInPercentage, *
rows Set how many rows in a frameset and their sizes sizeInPixels, sizeInPercentage, *

Standard attributes

class, id, style, title

For more information on standard attributes, check out our HTML standard attributes reference page.

Event attributes

onload, onunload

For more information on event attributes, check out our HTML event attributes reference page.

Example

<frameset rows="20%, 60%, 20%"> <frame src="menu.html" name="menu" noresize="noresize" /> <frame src="content.html" name="content" noresize="noresize" scrolling="yes" /> <frame src="footer.html" name="nav" noresize="noresize" marginheight="10" /> </frameset>
Output:

Click here to see the frame in a window by itself

Tips & notes

When creating a frames page, do not use the <body> tag. However, if you use the <noframes> tag, sorround the content in it with <body></body> tags.

You don't have to limit yourself to just columns or just rows in a frameset, you can combine both to create a mixed frameset! This kind of thing would be useful for a specific type of navigation such as a page with a header, left side navigation, and right side content. Check out our mixed frames example to see a mixed frameset in action.

Frames caution

Frames require your visitors to load more than one page at a time. This can create bandwidth issues (more pages to load at a time) and time issues (extra time spent loading pages) that will negatively affect your website and your users experience.

Web Reference
  1. CSS reference
  2. RSS reference
  3. HTML reference


© Copyright 2011-2012 Landofcode.com
Terms of use | Privacy policy | Copyright information | Make a donation