HTML Tutorial


Lesson 9
About Frames

Frames let you split the browser window into different sections. Each section is defined by at least three tags, <frameset>, <frame src=> and </frameset>.

The <frameset> tag will be either <frameset row="r1,r2,...,rn"> or <frameset col="c1,c2,...,cn">, where n is the number of horizontal frames you will stack (rows=) or the number of vertical frames you will place next to each other (cols=). The numbers after the equal sign give the browser the size in pixels or percentage of the rows or columns. You may use an * for rn or cn to tell the browser to use the rest of its window for the last row or column.

NOTE: While Internet Explorer will accept a <frameset> tag without a row= or a col=, Netscape browsers will not. You will also need a comma after your r1 or c1 even if you do not have an r2 or c2.

Each row or column requires a corresponding <frame src=> tag before the </frameset>. The <frame src=> tag contains the link to the file with the actual HTML code which the browser will display within the frame.

NOTE: Pages with frames do not have a <body> or a </body> tag; therefore they cannot display anything independent of the frames.

For your visitors whose browsers do not support frames, you might wish to include something like:

<noframes>
<center>
Your browser does not support frames.
Please click <a href="(appropriate URL)">here</a>.
</center>
</noframes>

NOTE: Since many search engines cannot link to material within frames, they simply do not list pages which use frames. You might consider this when designing your site.

LESSON 8 | HOME PAGE | LESSON 10

© Geo. McCalip 2001