Page 68 - DCAP408_WEB_PROGRAMMING
P. 68
Web Programming
Notes determines the width (for columns) and height (for rows) of the regions; the number of
width and height values supplied determines how many rows and columns, respectively,
are created. The default for each is one. For example, if you have:
<FRAMESET cols=”20%,30%,50%”>
In which there is no ROWS value, the frame set is divided vertically into three regions: the
first region’s width is 20% of the current frame set (or browser window if this frame set is
at the top level), the second region’s width is 30%, and the third region’s width is 50%.
When there is only one frame set in the document, these widths apply to the entire
browser window. Similarly, when there is a ROWS value but no COLS value, the frame set
is divided horizontally into regions. When values are supplied for both attributes, the
frame set is divided into a grid of rows and columns.
The ROWS and COLS attributes take comma-separateds lists of values. These values can be
absolute pixel values, percentage values between 1 and 100, or relative scaling values. The
number of rows and columns is implicit in the number of values in the respective list.
Since the total height of all the rows must equal the height of the window, row heights
might be normalized to achieve this.
Notes If the rows (or cols) attribute values are unspecified, then the number of rows
(or columns) is assumed to be one, and it may be arbitrarily sized to fit.
Syntax of Value List
value
A simple numeric value is assumed to be a fixed size in pixels. The result of this
value varies with the size of a viewer’s window. Fixed pixel values are usually used
with one or more of the relative size values described below. You might use a fixed
value if you want a graphic, such as an image map, to fill an entire frame and you
want to ensure that the frame is big enough to display the entire image. User agents
can be expected to over ride a specified pixel value to ensure that the total proportions
of a frame are 100% of the width and height of a user’s window.
value%
This is a simple percentage value between 1 and 100. If the total is greater than 100,
all percentages are scaled down. If the total is less than 100, and relative-sized
frames exist, extra space is given to them. If there are no relative-sized frames, all
percentages are scaled up to match a total of 100%. For example, suppose you assign
the ROWS attribute a value of “50%, 50%, 50%”. Each entry is 50%, which is one third
of the sum of all the entries (150%), so the browser assigns the frame sizes
proportionately, giving each frame one third of the browser height.
value*
The value on this field is optional. A single ‘*’ character is a “relative-sized” frame
and is interpreted as a request to give the frame all remaining space. If multiple
relative-sized frames are specified, the remaining space is divided evenly among
them. If there is a value in front of the ‘*’, that frame gets that much more relative
space. “2*,*” would give 2/3 of the space to the first frame, and 1/3 to the second.
Example: Setting Frame width and height
There are three ways to specify the width or height of a frame
As a percentage of the area allotted to the parent frame set
62 LOVELY PROFESSIONAL UNIVERSITY