HTML and CSS Reference
In-Depth Information
of the frames. The rows and cols attributes of each frameset specify how much room the
frame will need within the window. These values use exact pixels as a default, although
you can also use percentages to represent a section of the window, or an asterisk * to
allocate leftover space. (These size values will be shown in Examples 10.15 and 10.16.)
Creating HTML Frames. In Example 10.14 the window is divided into two frames:
a left frame that takes up 25 percent (in columns) of the window and a right frame that
takes up 75 percent (in columns) of the rest of the window. Because files are required to
accomplish this, the main file defines the frameset, the second file contains the HTML
code for the left frame, and the third file contains the HTML code for the right frame.
Table 10.10 HTML Frame Tags
Tag
Attribute
What It Does
<frameset>
Defines a collection of frames or other framesets.
border
Sets frame border thickness (in pixels) between all the
frames.
frameborder
Draws 3D separators between frames in a frameset. A
value of 1 or yes turns frame borders on; a value of 0 or no
turns them off.
rows
Defines the number and size of rows in a frameset.
cols
Defines the number and size of columns in a frameset.
<frame>
Defines attributes of specific frames.
name
Used by JavaScript to reference the frame by name.
src
The URL or location of the frame.
EXAMPLE 10.14
<html>
<head><title>Frame Me!</title></head>
<!-- Creating the framesets for two files -->
<!-- This file is named: framesets.html -->
1
<frameset cols="25%,75%">
2
<frame src="leftframe.html" >
3
<frame src="rightframe.html" >
4
</frameset>
</html>
 
Search WWH ::




Custom Search