Ken Ward's HTML Tutorial ...

Frames - The Code!

As you can see, there are three pages shown in this frame. The frames page, framesFrame.htm, loads the files according to our instructions.

Let's look at the code for this example;

First the code begins with;

<frameset rows="15%,*">

The interesting bit is the ROWS="15%,*" because this will first divide the page into two rows; The first will be 15% of the screen, and the other row will take up the rest (,*) We could have used a value rather than an asterisk, but overall, because we don't know what browser and screen settings are being used, we might as well leave the value up to the browser. This is more important when we use pixels instead of percentages.

So the code divides the page into two rows, one 25% of the screen, and the other, the rest - 75%!

The next row of the code is;

<frameset rows="15%,*"> <frame name="topframe" id="topframe" src="topframe.htm" scrolling="auto" />

We tell the browser the URL of the file we want to load, SRC="topframe.htm", and the name of this window in the frame, in this case, topframe. Do you remember when we used SRC to load images? You can see a scroll bar on this page. The frames page gives us the option of having a scroll bar;

<frame scrolling="yes" />,

not having one;

<frame scrolling="no" />,

or having one as needed <frame scrolling="auto" />, when the scroll bar appears if the page is too long for the screen, and doesn't appear if the page is short!

We have already told the browser which file to load in the top frame, the name of the frame, and whether we want scroll bars or not.

Let's look at the columns now!

[back to: frames]
[on to:  columns ]

Most Recent Revision: 18-Oct-98.
Copyright 1998

I am always pleased to hear from you.
Send your comments to
and please visit: New Life Course