Frames
With frames, you can display more than one HTML document in the same browser window. Each HTML document is called a frame, and each frame is independent of the others.
The disadvantages of using frames are:
- The web developer must keep track of more HTML documents
- It is difficult to print the entire page
The Frameset Tag
- The
- Each frameset defines a set of rows or columns
- The values of the rows/columns indicate the amount of screen area each row/column will occupy
The Frame Tag
- The tag defines what HTML document to put into each frame
In the example below we have a frameset with two columns. The first column is set to 25% of the width of the browser window. The second column is set to 75% of the width of the browser window. The HTML document "frame_a.htm" is put into the first column, and the HTML document "frame_b.htm" is put into the second column:
Note: The frameset column size value can also be set in pixels (cols="200,500"), and one of the columns can be set to use the remaining space (cols="25%,*").
Basic Notes - Useful Tips
If a frame has visible borders, the user can resize it by dragging the border. To prevent a user from doing this, you can add noresize="noresize" to the tag.
Add the
Important: You cannot use the
tags together with the tags! However, if you add a This example demonstrates how to make a navigation frame. The navigation frame contains a list of links with the second frame as the target. The file called "tryhtml_contents.htm" contains three links. The source code of the links:
Frame a
Frame b
Frame c
The second frame will show the linked document.
Frame Tags
| Tag | Description |
|---|---|
| Defines a set of frames | |
| Defines a sub window (a frame) | |
| Defines a noframe section for browsers that do not handle frames | |
| Defines an inline sub window (frame) |