Dynamic Web pagesHTMLTablesFrames

Frames

Frames are a technique for displaying multiple documents inside one window. Be cautious before you decide to use frames, as frames have drawbacks.

One--some would say the only--reasonable use of frames is to display a fixed navigation bar that is independent of the changing content of the main part of the page. When browsers support the floating objects and inline boxes defined in HTML 4.0, even this use of frames may become obsolete.

A simple document with frames could look like the following.

<html> 
<head>
<title>A sample document with frames</title>
</head>
<frameset cols="20%, 80%">
   <frame src="Contents.html">
   <frame src="Main.html">
   <noframes>If your browser does not support
frames, you can <a href="Main.html">load
the main page directly</a>.
   </noframes>
</frameset>
</html>

This code creates two frames. The left-hand frame (for a navigation bar, for example) takes up 20% of the width of the screen and loads the document named Contents.html. The right-hand frame takes up the remaining width of the screen and loads the document named Main.html. The <noframes> tag is for the benefit of browsers that do not understand frames.

For more about frames, see the official documentation from the World Wide Web Consortium.


logo The Math 696 course pages were last modified April 5, 2005.
These pages are copyright © 1995-2005 by Harold P. Boas. All rights reserved.
 
Dynamic Web pagesHTMLTablesFrames