Create a website RSS feed

The Frameset Element

The frameset Element

Last update on: 07-16-2008
The <frameset> element replaces the <body> element in frameset documents. It is the attributes of the <frameset> element that specify how the browser window will be divided up into rows and columns; these attributes are as follows:

The <frameset> element contains a <frame> element for each frame of the document (or each cell of the grid constructed by the <frameset> element) and a <noframes> elements to indicate what should be displayed to the user if their browser does not load frames.

The cols Attribute
The cols attribute specifies how many columns are contained in the frameset and the size of each column. You have to provide a value to indicate the width for each of the columns in your frameset, and the number of values you provide (each separated by a comma) indicates how many columns there are in the document. For example, here there are three columns: the first takes up 20 percent of the width of the browser window, the second takes up 60 percent, and the third takes the last 20 percent:
<frameset cols="20%, 60%, 20%">
Because there are three values, the browser knows that there should be three columns.
You can specify the width of each column in one of four ways:

If you do not specify a cols attribute then the default value is 100 percent, so, if you do not specify a cols attribute then there will be one column that takes up 100 percent of the width of the browser.
The rows Attribute:

The rows attribute works just like the cols attribute and can take the same values, but it is used to specify the rows in the frameset. For example, the following rows attribute will specify three rows: the top row should be 100 pixels tall, the second should be 80 percent of the screen, and the bottom row should take up the screen that is left (if anything):

<frameset rows="100, 80%, *">

The default value for the rows attribute is 100 percent so, if you do not specify a rows attribute, one row will take up 100 percent of the height of the browser.

Border, frameborder and framespacing attributes

The border attribute specifies the width of the border of each frame in pixels.
The frameborder attribute specifies whether a three-dimensional border should be displayed between frames.
The framespacing attribute specifies the amount of space between frames in a frameset. The value should be given in pixels and the default value is 2 if not otherwise specified.

<frameset rows="100, 80%, *" border="0" frameborder="0" framespacing="0">

Working with Frames's lessons:

Introduction To Frames
When To Use Frames
The Frameset Element
The Frame Element
The Noframes Element
Creating Links Between Frames

Banner HomeServices Contact |  ©2009 http://www.iteachweb.net/