The Tags: <frameset ...> </frameset>
Layout documents are different from contents documents in that they contain no
<body> tags. Instead, the
<body> tags are replaced with
<frameset> tags. These
<frameset> tags describe how the document area should be divided into frames through the name-value pairs
cols=column_list, which are mandatory parts (one or the other, but not both) of the
<frameset> tag. Note that because it is possible to nest framesets within framesets (as we demonstrated in Lesson 1), the "document area" to be divided by a
<frameset> tag may be either the entire browser window or just a frame created by an outer frameset.
A row list is a comma separated list of values which tells the browser how to divide the document area into rows. The width of these rows, of course, is just the width of the document area, but the height and number of rows is determined by the actual values in the list. The number of rows is, simply enough, just the number of values in the list. The height of the rows is determined by the values, which can be given in pixels, percentages, or relative weights:
For example, if the row list in the <frameset> tag is "
rows=30,25%,*,2*", then the document area will be divided into rows as follows:
Unfortunately, it is possible to specify a row list such that the total height of all rows is not equal to the document area's height. This kind of row list is called an improper row list, and though it is not necessarily bad, it can give unexpected results. The best way to avoid this problem is to 1) use common sense (more important than you might think) and 2) specify at least one row with an asterisk value. In fact, any row list containing a pixel value but no asterisk value must be improper. (See the section "Improper Frame Lists" in the next lesson for information on how browsers deal with improper row lists.)
By analogy, column lists work the same way as row lists, except that they specify column divisions rather than row divisions. (If this explanation doesn't satisfy you, then go back and reread the description for row lists, replacing the words row for column, column for row, width for height, height for width, top for left, and bottom for right.)
Note: Microsoft, in its usual tradition of making things more confusing than they really need to be, has proposed two mechanisms for hiding borders. The first method is to set the frameset's |
The second method is to set the
Although Internet Explorer 3 supports these two properties, I recommend that you do not use them -- unless, of course, you want to help Microsoft take over HTML and screw that up too. :-)
border property is used to set the width, in pixels, of the dividing bar between frames in a frameset. If you want the border to go away entirely, set the border width to zero. The
border property is new to Netscape 3 and is not supported by Internet Explorer 3 or older versions of Netscape.
If you choose to let your frame borders show, you can set their colors with the
bordercolor property. The color must be specified as either an RGB triplet or as a common color name. For example, the tags
<frameset cols="*,*" bordercolor="#ffff00">
<frameset cols="*,*" bordercolor=yellow>
bordercolor property was first introduced in Netscape 3 and is not supported by older browsers.
Next: The Tags: <frame ...>
[ menu | previous page | next page ]