The Frame Tags
There are three tags you need to know to create frames (four if you include an Internet Explorer tag).
This is the grouping of frames that makes up the window for the browser. It must include the </frameset> tag.
This defines what document goes into the frameset.
Browsers that can't show frames will show what is found in the noframes portion of the page
This is an inline frame that behaves similarly to an inline image. It is an IE extension.
The frameset takes the place of the body of your HTML. It is loaded instead of
a straight HTML page. So the start of your framed page should always have:
You define the number and location of frames within the frameset tag. You define rows and columns and their size. This is the only required attribute for the frameset tag.
Rows and cols accept a quote-enclosed, comma delimited list of values that specify the absolute (in pixels) or relative (in percentages) size of the frames.
- <frameset rows="100,200,300">
defines a three frame page with absolute frame sizes. The top row is 100 pixels, the middle is 200, and the bottom is 300.
- <frameset cols="100,200,300">
This is the same type of frameset, only in columns.
- <frameset rows="25%,65%,10%">
This frameset has three frames, but their size is based on the size of the browser. The first frame is 25%, the second 65%, and the third 10%.
If you are anything like me, you can't add (or don't want to), but framesets are flexible. If you use an asterisk (*), that will represent all the remaining space. So, to make the above examples more flexible, you could write:
- <frameset rows="100,200,*">
This frameset has three frames, 100 pixels, 200 pixels, and whatever is left of the browser window.
- <frameset cols="100,*,300">
You can also put the asterisk in the middle to make fixed right and left frames.
- <frameset rows="*,65%,*">
If you use more than one asterisk, they will divide the remaining space up evenly between them.
The other attributes of the frameset tag are:
Defines the border width, in pixels. Netscape only.
Defines the number of pixels between frames. This affects all frames and any nested framesets. Internet Explorer only.
This disables or enables the border on the frames. 0 or no turns them off. 1 or yes turns them on.
Use a color name or hex triplet as a value to define the color you want the border to be. Netscape only.
None of these tags are defined in the frames specification of HTML 4.0 as part of the frameset tag. However, Netscape and Internet Explorer support different aspects of them.