back next

Frames


To create a frame definition documnet, you use the <frameset> tag. When used in an HTML document, the <frameset> tag replaces the <body> tag as shown here

<html>
<head>
<title>HTML Tutorial</title>
<head>
<frameset>
your frame definition goes here.
</frameset>
</html>


The cols attribute
When you define a <frameset> tag, you must include one of two attributes as part of the tag definition. The first of these attributes is the cols attribute which takes the following form:

<frameset cols="column width, column,...">

You define the width of each frame in one of three ways: explicitly in pixels, as a percentage of the total width of the <frameset>, or with an asterisk (*). When you use the *, your browser uses as much space as possible for the specified frame.


Example
<frameset cols="100,50%,*">



Output
result





The rows attribute
The rows attribute works the same as the cols attribute, except that it splits the screen into horizontal frames rather than vertical ones.


Example
<frameset cols="50%,50%,">



Output
result




The <frame> tag

Example
<html>
<head><title>HTML Tutorial</title>
</head>
<frameset rows="100,50%,*">
<frame src="example1.html">
<frame src="example2.html">
<frame src="example3.html">
</frameset>
</html>



Output
result





Back to HTML tutor homepage | Back | Next | Email me