
rames let you divide an HTML page into different areas, each displaying different content. If you are using a frames-compatible browser (Netscape Navigator 2.X or IE 3.X or later) you are seeing this section in frames. The table of contents to your left is in one frame. The words you are reading right now, are in another frame.
<frameset cols="XX,XX" or rows="xx,XX">
<frame src="URL" name="frame-name" marginwidth="X" marginheight="X">
<frame src="URL" name="framename" marginwidth="X" marginheight="X">
</frameset>
Frames can make your site easier to navigate, cleaner, faster, and more attractive. They can also be overused and ugly. The code you write to create frames is very simple; the real challenge lies in designing with frames.
There is an element on the web that is "anti-frame." These people have some good reasons to discourage frame use. Early implementation of frames had some odd technical quirks that made the reader's experience awkward. In addition, there were many places where frames were poorly applied and made the page confusing and ugly.
And that's all the more reason to think about why you are using frames and to explore, through your design process, whether frames are the best solution.
What Frames Do
With frames, you can create a user interface to your Web sites. Frames let you:
- Continually display components without refreshing them. This makes frames an ideal application for a navigational bar that appears throughout your site.
- Define a relationship between pieces of the web page. For example, clicking on a button in one frame can make content appear in another frame. This lets the table of contents control what appears in the content window.
A set of defined frames is called, logically enough, a frameset. The frameset defines each frame's size, name, and contents.
Each frameset can define a group of vertical frames or a group of horizontal frames. Framesets can be nested within each other, which is how you create a page with both horizontal and vertical divisions.
You can tell different files to display in a specific frame within the frameset.
Planning for Frames
Before you start typing frame commands and building a framed page, take a few moments to really look at the components of your site. Some people find it helpful to make an outline or a list. As you review the contents of your site ask yourself:
- How is the information organized?
- How will people navigate through the information?
- Will there be repeated elementsa table of contents? A set of buttons? A graphic?
- How are the elements related to each other? Do you want certain elements to always appear together?
If you've done print design, building a frameset is a little like building a grid. It defines the underlying structure within which information will be displayed.
Or, if you've done any gardening, it's a little like setting up a flowerbed into which different flowers will appear in different sections throughout the year. The success of your overall website is related to your underlying presentation structure, so think about your frames carefully.
Good Uses of Frames
The best uses of frames are relatively simple designs. Typically they have no more than two horizontal and two vertical divisions. Some of the best uses of frames divide the screen into only two parts.
Often, one of the frames will contain a set of buttons or a table of contents. This frame will seldom vary. It lets readers know what is part of the site and makes it easy for them to jump from one part to another.