|
|
Frames
Frames are not as intimidating as they look, likewise they are not the evil they are made out to be. You may have heard negitive input regarding frames, but that is usually because they are improperly written, therefore they confuse the reader and make viewing the page sometimes impossible.
Like tables, you have to think of frames in terms of collumns and rows. Let's start with a simple 50/50 split of your browser screen.
To create a split screen, you actually need three seperate HTML files.
The first, we will call one, the second we will call two and the third we will call A.
one.htm would contain what you want on the left column. two.htm contains all that you want on the right collumn. A.htm would have this code so that both are displayed together:
<FRAMESET COLS="50%,50%">
<FRAME SRC="one.htm">
<FRAME SRC="two.htm">
</FRAMESET>
This will open another window to demonstrate a 50/50 frame.
A.htm
Now, some fancier moves and options.
Lets say you want your menu to appear on the left side of the screen (using about 20% of the screen, and you'de like the right side to contain the regular HTML file:
<FRAMESET COLS="20%,80%">
<FRAME SRC="three.htm" NAME=menu>
<FRAME SRC="four.htm" NAME=_child>
</FRAMESET>
* Very Important- If you want your main document (the right frame in this case) to be the target of what is displayed when you click on a menu item, you must do this:
In your link (on the menu page) You must set it up as follws:
<A HREF="link.htm" target=_child>Link</A>
Demonstration:
B.htm
To open a new browser to view a page, use this code:
<A HREF="link.htm" target="_blank">Link
Three frames
Let's say you want to have a top frame for your banner, a side frame for your menu and the rest dedicated to the literature and picture content of your page. Here are the basics on how to do that.
<FRAMESET ROWS="10%,*">
<FRAME SRC="zero.htm" NAME=_top>
<FRAMESET COLS="20%,80%">
<FRAME SRC="one.htm" NAME=menu>
<FRAME SRC="two.htm" NAME=_child>
</FRAMESET>
</FRAMESET>
A demonstration:
C.htm
Moving on...
Some options to play with:
NORESIZE - (No re-size) If you include this option, your frames will not be resizable by viewers.
SCROLLING - Yes or no. Do you want viewers to be able to scroll up and down that frame? If it is a short menu, NO would be fine, but if it is the main frame, you should say YES.
BORDER COLOR - Just as it says, if you have a FRAMEBORDER, then you could color correspond your borders to a nice contrasting color.
FRAMEBORDER - (Yes or no). Do you want a border around your frame? Try a number between 0-5. Experiement and see what you like.
Go Back To