<FRAMESET> | NN 2 IE 3 HTML 4
<FRAMESET>...</FRAMESET> | HTML End Tag: Required
Defines the layout of a multiple-frame presentation in a browser's application window. The primary duty of the frameset element is to specify the geographical layoutin a row and column arrayof rectangular frames. Attributes defined in a frameset element apply to all frame elements nested within (unless overridden by a similar attribute for a specific frame). A frameset element's tag takes the place in an HTML document that is normally devoted to the body element. You may nest a frameset element within a frameset element. This tactic allows you to subdivide a frame from the outer frameset element into two or more frames. For example, if you define one frameset element with three rows and two columns, you get a total of six frames: Figure 8-1 shows the resulting frame organization. On the other hand, if you nest a frameset where a frame definition goes, that frame is divided into whatever frame organization is defined by that nested frameset. Consider the following nested frameset: This produces the frame organization shown in Figure 8-2. You may nest frameset elements as deeply as your page design requires. Be aware that frames can devour memory resources of browsers on some operating systems. Not all users appreciate frames that display borders, even when such a structure may make logical sense for your page design. The outermost frameset document is the one whose title attribute governs the display in the browser window title bar. Documents loaded into individual frames have no control over title bar display, although for reasons of scripting and potential application in future browsers, the title attribute of framed documents should be set anyway. If you wish to offer an option for a user to remove a frameset, you can supply a link or button that invokes a script. The script should set the top.location.href property to the URL of the single most important document of the pages loaded into frames (the primary content). Strict DTDs for HTML 4 and XHTML explicitly exclude support for frameset and frame elements (and target attributes of other elements that point to frames). These document type definitions treat frames as outside the scope of pure document markup. You can validate a framesetting document with the HTML 4 transitional and frameset DTDs or the XHTML frameset DTD.
Example
    <FRAMESET cols="150,*">
        <FRAME name="navbar" id="navbar" src="nav.html">
        <FRAME name="main" id="main" src="page1.html">
    </FRAMESET>
Object Model Reference
    [window.]document.getElementById(elementID)
Element-Specific Attributes
border | bordercolor | cols | frameborder | framespacing | rows
Element-Specific Event Handler Attributes
Handler | NN | IE | HTML
onload | 2 | 3 | 4
onunload | 2 | 3 | 4

border | NN 3 IE 4 HTML n/a
border="pixelCount" | Optional
Frames display 3-D borders by default. The default thickness of that border varies with browser and operating system. You can adjust this thickness by assigning a different value to the border attribute of the frameset. Only the outermost frameset element of a system of nested framesets responds to the border attribute setting. Note that this attribute controls inter-frame borders, and not a border around the frameset. Navigator 4 is consistent across Windows and Macintosh platforms by displaying a default border that is the same thickness as when the border attribute is set to 5. For IE, the default value is 6 in Windows and 1 on the Mac (although the actual rendering is far more than one pixel wide). Any single setting you make for the border attribute therefore does not look the same on all browsers. Moreover, at smaller settings, some browsers react strangely. IE 6 won't display a border in Windows when the value is 4 or less; Navigator loses its 3-D effect when the value is 2 or less. Navigator 4 also has a nasty habit of rendering an odd divot in the center of frame bars on the Macintosh. This hodge-podge deployment of frame borders may make you shy away from using them altogether (set the border attribute to 0). In some cases, however, borders provide reassuring visual contexts for frame content that requires a scrollbar. Having a scrollbar appear floating in a browser window might be disconcerting to some viewers. That the HTML 4 specification does not include a border attribute might lead one to believe it prefers the use of style sheet borders instead of borders tied only to frames. At most, however, a border-related CSS style attribute affects only a border around the entire frameset, and has no impact on borders between frames.
Example
    <FRAMESET cols="150,*" border="0">...</FRAMESET>
Value
An integer value. A setting of zero eliminates the border entirely. Although the value is supposed to represent the precise pixel thickness of borders in the frameset, this is not entirely true for all operating systems or browsers.
Default
See description.
Object Model Reference
    [window.]document.getElementById(elementID).border

bordercolor | NN 3 IE 4 HTML n/a
bordercolor="colorTripletOrName" | Optional
Establishes the rendering color for all visible borders in a frameset. A bordercolor setting in an outermost frameset element may be overridden by a bordercolor attribute of a nested frameset element (for the nested frameset's frames only) or an individual frame element. Browsers resolve conflicts of colors assigned to adjacent frames differently. Test your color combinations carefully if you mix border colors.
Example
    <FRAMESET cols="150,*" bordercolor="salmon">...</FRAMESET>
Value
A hexadecimal triplet or plain-language color name. See Appendix A for acceptable plain-language color names.
Default
Browser default, usually a shade of gray with black or blue highlighting for the 3-D effect.
Object Model Reference
    [window.]document.getElementById(elementID).borderColor

cols | NN 2 IE 3 HTML 4
cols="columnLengthsList" | Optional
Defines the sizes or proportions of the column arrangement of frames in a frameset. If you intend to use the frameset element to create frames in multiple columns, you must assign a list of values to the cols attribute, with one value per column. Column size is defined in one of three ways: Use an absolute pixel size when you want the width of a frame to be the same no matter how the user has sized the overall browser window. This is especially useful when the frame is to display an object of fixed width, such as an image. Use a percentage when you want the frame width to be a certain proportion of the frameset's width, no matter how the user has adjusted the size of the overall browser window. If you use all percentage values for the cols attribute, they should add up to 100%. If the values don't add up to 100%, the browser makes the columns fit anyway. Finally, use the asterisk wildcard value to let the browser calculate the width of one frame when all other frames in the frameset have fixed or percentage values assigned to them. Separate the values within the attribute value string with commas. You can mix and match all three types of values in the attribute string. For example, consider a three-column frameset. If you want the leftmost column to be exactly 150 pixels wide, but the middle column must be 50% of the total frameset width, set the value as follows: The precise width of the two rightmost frames is different with each browser window's width adjustment. The rightmost frame width in this example is roughly equal to one half the width of the frameset minus the 150 pixels reserved for the leftmost frame. You may define an invisible column to the right. Use percentage values for visible columns, and make sure they total 100%. Then assign the asterisk value for the final column. To create a regular grid of frames, assign values to both the cols and rows attributes in the frameset element's tag. For an irregular array, you must nest frameset elements, as shown in the description of the frameset element, earlier in this section.
Example
    <FRAMESET cols="25%,50%,25%">...</FRAMESET>
Value
Comma-separated list of pixel, percentage, or wildcard (*) values. Internet Explorer 4 for the Macintosh exhibits incorrect behavior with some combinations that include a wildcard value.
Default
100%
Object Model Reference
    [window.]document.getElementById(elementID).cols

frameborder | NN 3 IE 3 HTML n/a
frameborder="borderSwitch" | Optional
Controls whether all frames within the frameset display a border (acting as dividers between frame edges). The frameborder attribute of frame elements can override the frameset element's setting for this attribute, but some frame organizations don't lend themselves well to eliminating frames from subgroups of frames. Override the frameset element's attribute with caution, and test on all browsers and operating system platforms.
Example
    <FRAMESET cols="25%,50%,25%" frameborder="no">...</FRAMESET>
Value
On-off values for this attribute vary with the browser. Navigator uses yes and no. Internet Explorer 4 and later accepts both yes | no and 1 | 0. For cross-browser compatibility, use the yes/no pairing.
Default
yes
Object Model Reference
    [window.]document.getElementById(elementID).frameBorder

framespacing | NN n/a IE 3 HTML n/a
framespacing="pixelLength" | Optional
The Internet Explorer framespacing attribute is an older version of the border attribute. The older attribute is supported in current IE versions for backward compatibility. The behavior of the framespacing attribute is more uniform across operating system versions of IE: a setting of 10 pixels generates a border between frames that is essentially identical in both Windows and Mac versions. For an IE-only deployment, the framespacing attribute is a more accurate way to create borders that look the same across operating system versions.
Example
    <FRAMESET cols="25%,50%,25%" framespacing="7">...</FRAMESET>
Value
A positive integer. Unlike the border attribute, however, a setting of zero does not remove the border. Use the frameborder attribute to hide borders entirely.
Default
2
Object Model Reference
    [window.]document.getElementById(elementID).frameSpacing

rows | NN 2 IE 3 HTML 4
rows="rowLengthsList" | Optional
Defines the sizes or proportions of the row arrangement of frames in a frameset. If it is the intent to use the frameset element to create frames with multiple rows, you must assign a list of values to the rows attribute, with one value per row. Row size is defined in one of three ways: Use an absolute pixel size when you want the height of a frame row to be the same no matter how the user has sized the overall browser window. This is especially useful when the frame is to display an object of fixed height, such as an image. Use a percentage when you want the frame height to be a certain proportion of the frameset's height, no matter how the user has adjusted the size of the overall browser window. If you use all percentage values for the rows attribute, they should add up to 100%. If the values don't add up to 100%, the browser makes the rows fit anyway. Finally, use the asterisk wildcard value to let the browser calculate the height of one row when all other rows in the frameset have fixed or percentage values assigned to them. Separate the values within the attribute value string with commas. You can mix and match all three types of values in the attribute string. For example, consider a three-row frameset. If you want the bottom row to be exactly 80 pixels high to accommodate a navigation bar, but the middle row must be 50% of the total frameset height, set the value as follows: The precise height of the two topmost frames is different with each browser window's height adjustment. The topmost frame height in this example is roughly equal to one half the height of the frameset minus the 80 pixels reserved for the bottom row. You may define an invisible row at the bottom. Use percentage values for visible rows, and make sure they total 100%. Then assign the asterisk value for the final row. To create a regular grid of frames, assign values to both the cols and rows attributes in the frameset element's tag. For an irregular array, you must nest frameset elements, as shown in the description of the frameset element, earlier in this section.
Example
    <FRAMESET rows="25%,50%,25%">...</FRAMESET>
Value
Comma-separated list of pixel, percentage, or wildcard (*) values. Internet Explorer 4 for the Macintosh exhibits incorrect behavior with some combinations that include a wildcard value.
Default
100%
Object Model Reference
    [window.]document.getElementById(elementID).rows

style | NN 4 IE 4 HTML 4
style="styleSheetProperties" | Optional
This attribute lets you set one or more style sheet rule property assignments for the current element. You may use the CSS or (for Navigator 4 only) JavaScript syntax for assigning style attributes. Use the style attribute only with visible (renderable) elements.
Example
    <SPAN style="color:green; font-size:18px">Big, green, and bold</SPAN>
Value
An entire CSS-syntax style sheet rule is enclosed in quotes. Multiple style attribute settings are separated by semicolons. Style sheet attributes are detailed in Chapter 11.
Default
None.
Object Model Reference
    [window.]document.getElementById(elementID).style