HTML Notebook


     Basic frames should not be difficult, but there are a few things to remember when working with them.

     First off, if you dont set them up right, you can "trap" your visitor inside your frames. This is the reason that you often see "Trapped in a frame? click here to Break Out!". What the person is doing (when you click there) is "naming that frame", but before we get ahead of ourselves, lets first build the frameset.

<HTML>
<HEAD>
<TITLE>Amino's Castle</TITLE>
</HEAD>
<FRAMESET ROWS="10%,90%" BORDER="0">
  <FRAME src="top.html" NAME="TOPWIN" SCROLLING=OFF>
  <FRAMESET COLS="25%,75%" BORDER="0">
    <FRAME SRC="middle2.html" NAME="CHOICE" SCROLLING=AUTO>
    <FRAME SRC="main.html" NAME="MAIN" SCROLLING=AUTO>
  </FRAMESET>
</FRAMESET>
</HTML>

     This is the actual frameset for Aminos Castle. It works fine, but remember, this must be in a file all to it's self, and must be the page you referance. (like if the URL is www.mysite.com/mysite.html, the FRAMESET must be contained in the mysite.html document.)

     Notice that the FRAME SRC="top.html". What you are actually doing is loading a bunch of pages on the same page at the same time, so your frame source must be another webpage.

Name those Frames

     Notice in our example above, we have the line
<FRAME src="top.html" NAME="TOPWIN" SCROLLING=OFF>
This is where we assign each frame a specific name (NAME="TOPWIN").  In some cases (and I suspect UNIX of this), if you type in your frame name in all caps or all lower case, your target names must be in the same case, otherwise, nothing happens and you spend many hours pulling hair trying to figure out why.

     For example:
<A HREF="page1.html TARGET="main">
This would work only if the NAME of the frame were in lower case. As a good rule of thumb and good scripting practice, ANYTHING YOU PUT INSIDE " " SHOULD BE LOWER CASE!!

     Remember what I said earlier about trapping people inside of frames? The reason for that is if you have just a standard hyperlink (<A HREF="mypage.html">) inside a frame, it will remain inside that frame, even if that hyperlink is to another site entirely!!! And if that site uses frames as well, you end up looking like the smallest cow on the Pet Milk label.

     To counteract this, you want to break the frameset anytime you set a hyperlink to another site.
Example:
<A HREF="http://www.arrl.org" TARGET="_top">

     This will load the new site without your frames tagging along for the ride. :)

<A HREF="http://www.arrl.org" TARGET="_blank">

     Opens the new page in a new browser window.

<A HREF="http://www.arrl.org" TARGET="_parent">

     Restores previous frame settings


     Okay so now our page looks basicly something like this:




     I removed the tag BORDER="0" from the frameset to illustrate the borders of the frames. If you like the borders, just leave BORDER="0" out altogether, or you might even try playing around with the size of the borders (BORDER="2" or "3" ) You cant hurt anything, so have fun! :)

     Okay, so now we have named our frames, how do we know which name goes to which frame?




     First off, notice the syntax of the frameset again:
<FRAMESET ROWS="10%,90%" BORDER="0">
The easiest way I know to illustrate this principal is like this:
ROW1
ROW2
ROW3


<FRAMESET COLS="25%,75%" BORDER="0">
C C C
O O O
L L L
U U U
M M M
N N N
1 2 3
     Play with the values and see what you come up with. :)













| Back to Main Page | Previous Page | Next Page |
| Back to the Home Page | Questions? |