HTML and CSS Reference
In-Depth Information
the section called, appropriately enough, “The
<noframes>
Tag.”) The
<frameset>
tags
contain only the definitions for the frames in this document—what's called the page's
frameset
.
The HTML 4.01 specification supports the
<frameset>
tag along with two possible
attributes:
cols
and
rows
.
The
cols
Attribute
When you define a
<frameset>
tag, you must include one of two attributes as part of the
tag definition. The first of these attributes is the
cols
attribute, which takes the following
form:
<frameset cols=“
column width, column width,
...”>
The
cols
attribute tells the browser to split the screen into a number of vertical frames
whose widths are defined by
column width
values separated by commas. You define the
width of each frame in one of three ways: explicitly in pixels, as a percentage of the total
width of the
<frameset>
, or with an asterisk (
*
). When you use the asterisk, the frames-
compatible browser uses as much space as possible for that frame.
When included in a complete frame definition, the following
<frameset>
tag splits the
browser into three vertical frames, as shown in Figure 17.8. The fifth line in the follow-
ing code example creates a left frame 100 pixels wide, a middle column that's 50% of
the width of the browser, and a right column that uses all the remaining space:
Input
▼
<!DOCTYPE html>
<html>
<head>
<title>
Three Columns
</title>
</head>
<frameset cols=”100,50%,*”>
<frame src=”leftcol.html”>
<frame src=”midcol.html”>
<frame src=”rightcol.html”>
</frameset>
</html>