HTML Frames
With frames, you can display more than one web page in the same browser window.
Each HTML document is called a frame, and each frame is independent of the others.
The frameset
tag includes the following features:
- The
<frameset>
tag defines how to divide the window into frames.
- 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 disadvantages of using frames are
- The web developer must keep track of more HTML documents.
- It is difficult to print the entire page.
The example below has a frameset with two columns.
The first column is set to 30% of the width of the browser window.
The second column is set to 70% of the width of the browser window.
The HTML document 1p.html is put into the first column, and the HTML document 2p.html is put into the second column:
|
<frameset cols="30%,70%">
<frame src="1p.html" />
<frame src="2p.html" />
</frameset>
|
|
If a frame has visible borders, the user can resize it by dragging the border.
To prevent a user from doing this, add the attribute and its value
noresize="noresize"
to the
frame
tag.
Add the
<noframes>
tag for browsers not supporting frames.
Tag |
Description |
|
Tag |
Description |
<frameset> |
Defines a set of frames. |
<frame> |
Defines a sub window (frame). |
<noframes> |
Defines a noframe section for browsers that do not handle frames. |
<iframe> |
Defines an inline sub window (frame). |
†
Demonstration
The following demonstration shows how the HTML script is displayed on the Web.
The sales manager was at death’s door (very near death)
after his heart attack.
|