<frameset>, <frame>,
<noframes>
To make a page use frames, add a
<frameset>
tag
immediately after <head>
(this new tag effectively replaces <body>
. This tag takes
two attributes, cols
and
rows
, which specify the space taken by each frame
in the form of a comma-separated list. You can specify either the number
of pixels to use, a percentage, or "*" to mean the rest of the space
once the other values have been worked out. For instance,
<frameset rows="40,20%,*">
would divide the window
into three rows, the top-most being 40 pixels deep, the middle one
taking 20% of the window, and the bottom one taking the remainder of the
space.
Note that you don't have to specify cols
and
rows
in the same <frameset>
tag. Leaving e.g. rows
out will assume you only
want one row (and the same goes for columns); if you want a complicated
layout involving both columns and rows, you can use another
<frameset>
inside to divide the window up
further.
Once you've specified how the window is to be divided up with the
<frameset>
tag, you then describe the contents of
each frame using <frame>
(alternatively, replace this by another <frameset>
to
divide the frame into several other frames). This tag takes the
following attributes:
src="URL"
: specifies the URL of the
page to be loaded in this frame.
name="name"
: specifies the
name of this window, to be used with <a target>
.
marginwidth="value"
,
marginheight="value"
: sets the size of
the margin in the frame. Seriously optional.
scrolling="yes, no or auto"
:
decides whether the frame will scroll. "Auto" is the default value.
noresize
: don't allow the user to resize this
frame.
Don't forget the ending </frameset>
tag.
Use the <noframes>
tag to specify
what non-frame-savvy browsers should display. This should be a standard
HTML page, i.e. with <html>
,
<head>
, <body>
, the works.
Frame-capable browsers
will ignore anything between <noframes>
and
</noframes>
.
From version 2.0 onwards, Netscape allows you to "target" a specific
window with <a href=URL
target=name>
. (You can also use target
with <base>
, <area>
and
<form>
). The linked page is opened in the
corresponding window, if it exists; otherwise, a new one is opened.
Relying on targetting a new window so people will be able to see two
pages at once is not a reasonable thing to do.
You can define a default target for all links with the
<base>
tag.
The following special values can also be used as names:
<base>
<frameset>
. If you had a page divided into
three rows, with the middle one further divided into two columns, any
link from one of the middle frames targetted to _parent would replace
the two middle frames with one frame taking up the entire row.
Frames
syntax example from Netscape