Main  Basic   Advanced  Download  

Frames 2  

Ok, so you've managed to survive the first frame tutorial... What about this then?!

Frames may be very nice, but in my opinion they should only be used when you want a topic list on one side of the screen and the main page on the other, (an index frame and a main frame).
If you think about a page that has a large number of frames, it may look great on a high resolution monitor, but what about all those guys that have low resolution monitors! What will happen is that you get scrollbars everywhere, or, if you've specified the SCROLLING attribute as NO, then they won't see maybe half of what you've put up in that frame! Problem eh? The way to solve it is to use very few frames, three at most, and if you have anything that needs to be shown without scroll bars, then use the number of pixels that you want the frame to be high and wide, instead of the percentages. So, in other words, don't put the % sign in the frameset, just a number of pixels instead, e.g.

<FRAME SRC="crucialsizepage.htm">
<FRAME SRC="remainingscreenpage.htm">

This makes a page with a small 100 pixel wide frame on the left, and the remaining screen (*) is taken up by the non-crucial sized page.
Note: you obviously cannot specify a pixel width/height that is bigger than 640 wide or 480 high, as this would not fit on low resolution users' screens!

Frames, to look good, are quite often borderless, which means they don't show those little grey lines separating the frames. Fair enough, you say, does that make a difference? The answer is yes it does make a lot of difference. To get an idea of what borderless frames are about, visit Microsoft, British Telecom, or These sites have very good borderless frame pages, which do give some cool effects.
The code for borderless frames is placed in the frameset tag:


That makes any frame specified by that FRAMESET tag borderless.
Note: Netscape 4.0x replaces the grey with white if the above is done, whereas MS Internet Explorer eliminates the space altogether. A good way to not make this noticeable is make one of the frame's contents have a white background, so the space isn't noticeable.

Linking to and within framed pages isn't as easy as normal linking: if you have link in a frame and someone clicks it, the page linked to will appear in the actual frame it was linked from, not exactly desirable in many situations. The way to get round this is to use the TARGET attribute in links.
A link with a TARGET attribute simply specifies where the page that the link leads to appears: the full screen, another frame, even a new window! It's easy:

<A HREF="somepage.htm" TARGET="FRAMENAME">Link Text</A>

In between the inverted commas of the TARGET statement, place the name of the frame that you want the page to appear in. If you want a new window, make up a name for the window that isn't the same as any you have for your other frames, and then the browser will automatically create a new window, which you can treat just like another frame. If you want the page to appear full screen, set the TARGET attribute to "_top".


Copyright 1998 Iceman. All Rights Reserved. Further Legal Stuff

This page hosted by Get your own Free Home Page