|
Adding Frames
After you have told the browser how much space to allocate for each
frame, it is time to tell the browser what to put into each frame.
You do this with the FRAME element.
<FRAME> has the following attributes:
src This attribute is used to specify what should be loaded
into this frame.
name This is used to indicate the name to be associated with
this frame. This is the target name for the <A> element.
scrolling Scrolling has three values:
yes, no and auto. No does not allow scrolling. Yes gives you always a scrollbar.
Auto displays a scrollbar if the content doesn't fit into the frame.
frameborder Tells the browser whether to draw a border around this
frame (1, this is the default value), or not (0).
noresize This is a Boolean attribute. It tells the browser that this
frame is not resizable by the visitor.
marginheight marginwidth The height and width of
margin between frame contents and borders in pixels.
Here is an example on how a framed page would look like:
<FRAMESET rows="20%, 80%">
<FRAME src="top.html" frameborder="0" noresize scrolling="no">
<FRAMESET cols="30%, 70%">
<FRAME src="buttons.html" noresize scrolling="auto">
<FRAME src="main.html" scrolling="yes" name="main">
</FRAMESET>
</FRAMESET>
Header and logo |
navigator buttons |
The main window |
You should be very careful when adding links to a framed site. You should always
specify the target name. If you have the home button, you should put the _top value
for the target name. It will cancel the effects of frames. This is a common example
of unintentional nesting if you forget the target name.
Header and logo |
navigator buttons |
Header and logo |
navigator buttons |
The main window |
|
If you have a framed site, you will surely want to put a notice for visitor
that have browser that don't support frames. The element that allows that
is the <NOFRAMES> element. You should place the <NOFRAMES> element
in the outermost FRAMESET. It has a start and end tag, and the content
is standard HTML. You can make a special site for visitors that don't support
frames if you like with this element.
|