Some Guidelines for Creating Good Frames
You will find that many people do not like frames. The problem is
not so much that they are a bad idea, but their design is flawed,
and many web sites implement them badly. While Netscape (and others)
will tell you how the technical side works, what you don't often see
is a guide to doing frames well. These are my suggestions.
- In order to have a site that works smoothly with frames, design and
implement your site without frames. Get everything laid out, and solve
all your navigation problems. Then add frames.
- target="_top"
is your friend. Use it on every link to a page
outside your web site. No one should ever leave your site, and find
themselves looking at someone else's web page inside your frames.
- For that matter, since I no longer use frames, I put
<base target="_top">
inside the
<head>
element, which forces all links to pop out of frames. But you can only
do the <base> trick on unframed sites.
- Thanks to search engines and links, remember that anyone may enter
your site through any page. These people will not see your frames.
- Never force frames on anyone. Your home page should not be framed.
Give people the option of choosing to use frames, preferably without
using an entry page. See point 6, below.
- Once your frameset is displayed, do not ever reload it. Keep
your page loads inside your frames. The primary reason for this is that
the reader may resize the frames, and you will reset this when you
reload the frames document. So don't do it!
- It is a courtesy to your readers to make sure that all frames are
resizeable and have borders. Yes, you may end up with scroll bars and lines
in the display, but user's browsers may be set up differently from yours.
Things you put in small frames may not fit in the same frame on
their browser. Let users arrange frames to suit their viewing environment.
- On every page of your site, give people the choice of going into
frames, or getting out of frames. Either option should leave the reader
looking at the same page they were looking at before.
Number 7 is a bear to do right. A person who is already in frames shouldn't
have the option of going into frames. A person who is not in frames shouldn't
see the option of getting out of frames. Putting the "get out of frames"
link inside a site map frame is the friendliest way to do this, but it
means that the site map page and no-frame link have to know what page is
in the other frame to reload correctly.
The only implementation I've seen for this involves a lot of JavaScript,
and isn't portable out of Netscape (i.e., it doesn't work in MSIE). This
is why my site no longer has frames.
If you don't get all of these points right, frames can be more of a nuisance
than a help to your reader. Always remember that you are designing for
your readers, not for yourself.
At the same time, in order to design good frames, it's important to
recognize what frames take away from the reader. It's up to
you to compensate, either by providing an equivalent function, or by
providing enough value to offset these losses.
- In some browsers, frames take away the function of the back
button. To compensate, you can provide as much "back-navigation" features
as possible coded into your pages.
- Not all browsers will let a user bookmark a page within a frame. Even
if the browser has such a function, it may be hidden in such a way that
the user may not be aware of it. This is not a time to scream, "Stupid
users!" People don't surf the web in order to learn how to use a browser;
they surf for information. It's your job to make that information
available.
- Whatever you do, do not use one of those obnoxious status
line crawlers to obliterate the only other place that link information
is displayed. Some people are using "onMouseOver" to display a more
"meaningful" link explanation; again, that needs to be your link
text! Leave the status line alone.
- You are taking away space on the reader's screen. There is no
compensation for this, and some users simply have no way to use a
larger screen or different resolution. This is why you have
to provide enough value to justify your use of their
space.
- Do not use a whole frame for static but essentially useless
information like your name or your picture. Readers do not come to your
site for your name or your picture.
So there you have my view on frames. Now you understand why I don't
use them. Frames are not "cool" or "advanced technology." They are a
tool, and like any tool they can be abused.