Frames and Framesets
You have reached the last stop on our tour of HTML 4.0 - Frames & Framesets. Frames and Framesets provide you with greater control over the user interface of your web site. A frameset is a way to divide a single document into regions that can display multiple documents. A frame is basically any document container, whether it be a part of a frameset or defined within your document.
Below is a simple example of a Frameset document. Clicking on the table of contents causes the right hand document to be updated.
The above frameset was included on this page using an in-line frame - the <IFRAME> element. The <IFRAME< element
creates a container in the document for displaying other documents. As demonstrated, thsi document can even be a frameset. This element
was defined in this page as follows:
This element works very similar to the <OBJECT> element and allows you to provide contents to display if the browser does not support the <IFRAME> element.
The frameset being displayed above is created using a special type of HTML document. Instead of having a <BODY>, a
frameset document has a <FRAMESET>. This element contains <FRAME> for displaying documents or other <FRAMESET> elements that further
divide the screen. The frameset document displayed above is defined as follows:
The ROWS and COLS attribute on the FRAMESET element divide the screen into rows and columns. Both of these attributes take a comma-delimited list of values, where numbers are interpreted in pixels, percentagaes are based on available space, and * takes up any remaining space.
When defining a FRAME, the SRC defines the document to display, and the NAME is optional and provides a destination
for any navigation. For example, each item in the table of contents pane specifies that the document should be displayed
in the content pane:
In addition to targeting an existing frame, you can target a set of special values:
The <NOFRAMES> element is used to provide contents for browsers that do not support FrameSets. This element
can be used both in a FRAMESET definition or in the BODY of a document. By using it in the body of a document, you can specify
a navigation bar to display if the browser does not support FRAMESETS:
Imagine the above document was part of a frameset. If a browser does not support framesets, you may want the above document displayed by itself with the navigation bar contained directly in the page. The extra navigation bar is only displayed in browsers that do not support framesets correctly (note - Netscape Navigator only supports the NOFRAMES element in a FRAMESET document and will incorrectly display the extra navigation bar).
Copyright © 1997-2008 InsideDHTML.com, LLC. All rights reserved.