Lesson-7 (Frames)
The browser shows the web page through a window. We scroll the web page and see the entire document through the window of the browser. The window is called a container. It is possible to divide the container into several frames, and use each frame for displaying a different HTML document. Frames have the following characteristics.
A set of frames is defined using the <frameset> tag which ends with the </frameset> tag. The <frameset> tag has two attributes.
Frame 1 | Frame 2 | Frame 3 | Frame 4 |
Frame 1 |
Frame 2 |
Frame 3 |
The pixel unit simply represents the number of pixels (Picture Elements)
in each frame. Commas must seperate the numbers. For example, consider the following:
<frameset cols="150,70,70">
.......
.......
</frameset>
This definition creates three column-wise frames, with the first frame of 150
pixels width, the second of 70 pixels width and third also of 70 pixels width.
The percentage divides the window according to the specified percentages. For
example, consider the frameset definition:
<frameset rows=70%,30%>
.......
.......
</frameset>
In the above definition, two row-wise frames are defined in the container. The
first frame has 70% of the container and second one has 30% of the container. This
is illustrated in Fig 7.3.
Frame 1 (70%) |
Frame 2 (30%) |
If the total percentage is greater than 100%, all percentage are scaled down. If the sum of the percentage is less than 100, the extra spaces are left out.
Instead of using Pixel or Percentage units, we can use the fraction units
to represent the relative sizes of the frames. Suppose we give the following:
<frameset cols="4*,4*,*,*">
.......
.......
</frameset>
This defines four column-wise frames as shown in Fig. 7.4. The first two frames
have size of four units each, and the third and fourth ones have one unit each. So the
frame sizes are 4/10,4/10,1/10 and 1/10 of the container size.
4/10 | 4/10 | 1/10 | 1/10 |
7.2 Frame Definition
The definition of the frame is given using <frame> tag. The <frame> tag may have any of the following
attributes: