A frames
page consists of one or more pages placed
on a controlling page. This is the page we will create now.
The first command you must know is the <FRAMESET> command. This is the command
that actually creates the frames. You must tell
<FRAMESET> if you want columns or
rows. You must also tell <FRAMESET>
how large each frame should be. So, first set up
your basic code:
<HTML>
<HEAD><TITLE>This is the Control Page</TITLE></HEAD>
</HTML>
Notice that there is no <BODY>
command. This command is generally not used on a
framed page.
Now it is time to add in the <FRAMESET> command. Add it like so:
<HTML>
<HEAD><TITLE>This is the Control Page</TITLE></HEAD>
<FRAMESET COLS="50%,50%">
</FRAMESET>
</HTML>
Notice that the <FRAMESET>
command must be closed off.
Now, the Frames are set up to each take up half of the browser. Now for the important
part, the pages to add. This will use another command, the
<FRAME SRC> command.
<HTML>
<HEAD><TITLE>This is the Control Page</TITLE></HEAD>
<FRAMESET COLS="50%,50%">
<FRAME SRC="testone.html">
<FRAME SRC="testtwo.html">
</FRAMESET>
</HTML>
Now take a look at what you done.
As you can see, each page has taken up half of the space on the page. Dont like
that style? Try rows instead!
<HTML>
<HEAD><TITLE>This is the Control Page</TITLE></HEAD>
<FRAMESET ROWS="50%,50%">
<FRAME SRC="testone.html">
<FRAME SRC="testtwo.html">
</FRAMESET>
</HTML>
I can see your next question... can I use more then two pages at the same time? Of
course!
<HTML>
<HEAD><TITLE>This is the Control Page</TITLE></HEAD>
<FRAMESET ROWS="20%,20%,20%,20%,20%">
<FRAME SRC="testone.html">
<FRAME SRC="testtwo.html">
<FRAME SRC="testthree.html">
<FRAME SRC="testfour.html">
<FRAME SRC="testfive.html">
</FRAMESET>
</HTML>
Pretty confusing looking page isn't it? Remember that when using frames. Too many
frames can look confusing to anyone trying to view your page.
Now, there is one problem with the above examples. The effect you want is not what the
person on the other end may see if they use a different screen resolution then you. So,
try using pixels instead.
<HTML>
<HEAD><TITLE>This is the Control Page</TITLE></HEAD>
<FRAMESET COLS="140, *">
<FRAME SRC="testone.html">
<FRAME SRC="testtwo.html">
</FRAMESET>
</HTML>
Not bad, eh? Looks a little more like a table of contents page with a main page next to
it. Now, the * that was after the 140 means that whatever space is left over should be
taken by the other page.