Frames
Frames have been much maligned recently by Web devotees, probably because they have been abused and overused. But they really are useful. It's a little tricky to set up a frame, but here's how to do it.
First, you need to create an HTML document which will control the frames--kind of a master template, known as a frameset. This is the URL which you'll want users to access. The master template page would look something like this:
<HTML>
<FRAMESET COLS="25%,*">
<FRAME SRC="menu.html" NAME="Frame5555" MARGINWIDTH="0"
FRAMEBORDER="NO">
<FRAME SRC="CS101syl.html" NAME="Frame3333" MARGINWIDTH="0"
SCROLLING="yes" FRAMEBORDER="NO">
<NOFRAMES>
<BODY> Sorry, you need to use a browser capable of supporting frames.
Try this <a href="101home.html"> link.</a>
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML>
The tag which creates frames is the <FRAMESET> tag. The attribute here , COLS, controls the number and size of the vertical frames. Since there are two items (separated with a comma), there are two frames. The first, left-hand frame will occupy 25% of the screen; the second frame will occupy the rest of the screen, as indicated by the asterisk. You can change the frames to horizontal frames by typing ROWS instead of COLS. If you leave out the % sign when assigning screen size to a frame, it will display in absolute pixel size--which in this case would mean 25 pixels, which is real tiny.
The <FRAME > tag has several attributes. First, the SRC attribute loads a document into a frame. This will be the default page when a user first accesses the URL which contains the frameset. Usually the top (horizontal) or left (vertical) frame is a "menu" frame, like we have in our CS101 web site, so you would want to load the default page ONLY. You can also name the frames, which is important, because later when you include hot links you will want to specify that those web pages appear in your "main viewing" frame. Using the MARGINWIDTH or MARGINHEIGHT attribute, you can set the margin values in absolute pixels. Also, you can exclude scroll bars (SCROLLING = "NO"); you can prevent users from resizing a frame (NORESIZE); you can set FRAMEBORDER = "NO" to turn borders off.
Some browsers don't support frames (Netscape and IE do, and they account for over 90% of all browsers). To give a warning to those who can't handle frames, use the <NOFRAMES> tag around the <BODY> tag, with a message in the body, to let someone know they must have a frames-capable browser to view your site.
You can nest frames within each other. For example, the following HTML code will create a horizontal frame across the top and two vertical frames below. This would be useful if you wanted a menu bar along both the top and left of the window.
<HTML>
<FRAMESET ROWS="10,*">
<FRAME SRC="a.html" NAME=topframe>
<!-- here comes the nested, two bottom vertical frames -->
<FRAMESET COLS="20,*">
<FRAME SRC="b.html" NAME=leftframe>
<FRAME SRC="c.html" NAME=mainframe>
</FRAMESET>
</FRAMESET>
</HTML>
Click here to see what this might look like.