Any comments: e-mail me, feedback or show your appreciation

Frames in HTML

This section describes how to create framed HTML documents. Frames divide web pages into multiple, scrollable regions enabling you to present information in a more flexible and useful fashion. Each frame can be given an individual URL and name, allowing it to be targeted by other documents. It can also be dynamically resized depending on the user's window size. The Index of the Guide uses frames to display an A-Z section above the main scrollable index.

Currently, frames are only supported by Netscape 2 and above, and Microsoft Internet Explorer 3. For some more detailed tag descriptions, see Netscape's Implementation of Frames. There are also some further tips in the Guide's FAQs, including how to target two frames from one link.

Frames are displayed through a Frame Definition document. The frame definition describes the number and position of the frames and the URL of their contents. You cannot write the contents of the frames within the frame definition - these must always be held in separate documents.

| frameset | frame | no frames | targets | example | floating frames |



Example

The following example will use nested framesets to display frames in approximately the following fashion:
+------------+-------------------------+------------+
|            |                         |            |
|            |                         |            |
|            |                         |            |
|            |                         |            |
|            |                         |            |
|            |                         |            |
+------------+------------+------------+------------+
|                         |                         |
|                         |                         |
|                         |                         |
|                         |                         |
|                         |                         |
|                         |                         |
+-------------------------+-------------------------+


The Frame Definition

<html>
<head>
<title>Sizzling HTML Jalfrezi - frames example</title>
</head>
<FRAMESET ROWS="50%,50%">
    <FRAMESET COLS="150,*,150">
        <FRAME SRC="x_frame1.htm" SCROLLING="yes">
        <FRAME SRC="x_frame2.htm">
        <FRAME SRC="x_frame3.htm" NAME="frame3">
    </FRAMESET>
    <FRAMESET COLS="50%,50%">
        <FRAME SRC="x_frame4.htm" MARGINHEIGHT=50 MARGINWIDTH=50>
        <FRAME SRC="x_frame5.htm">
    </FRAMESET>
</FRAMESET>

<NOFRAMES>
You do not have a frame-compatible browser - this example won't work without
one.<BR>
<A HREF="frames.htm">Click here</A> to return to the Frames page.
</NOFRAMES>
</HTML>

View the example

The example shows all of the features of frames described above, including targeting windows and the noframes feature for non-frame compatible browsers.

Floating Frames

Microsoft Internet Explorer 3.01+ now supports the so-called floating frame. This is rendered using the <iframe> tag.



Sizzling HTML Jalfrezi
©1997 Richard Rutter Follow Colin to his Hoard
rrutter@woodhill.co.uk












Maintenance of this page is attempted by Richard Rutter (rrutter@woodhill.co.uk) using the gorgeous HTML Notepad and the wonderful Sizzling HTML Jalfrezi.