Frames |
Frames are a technique for displaying multiple documents inside one window. Be cautious before you decide to use frames, as frames have drawbacks.
A lot of users hate frames, which are based on a concept that many thoughtful people consider fundamentally flawed. Indeed, frames are no longer available in XHTML 1.1.
Framesets cannot be bookmarked.
Framesets are incompatible with text-only browsers.
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.
Frames |