10.0 Frames

Frames allow more than one HTML document to be displayed in a browser window at the same time. Each HTML document is called a frame and is independent of any other frame. There are advantages in using frames, such as being able to load the same navigation page into several other pages, but then there are disadvantages too, such as keeping track of simultaneous pages, difficulties with printing, and it can also be very bad for Search Engine Optimisation (SEO). Use frames with caution and only when they are really necessary.

The main tags used are:

TagPurpose
<frameset>Defines how to divide the window into frames
<frame>Specifies which HTML document to put into each frame
<noframes>Defines a noframe section for browsers that don't handle frames

And these are used with some useful attributes:

AttributePurpose
rowsDefines the height of a row
colsDefines the width of a column
srcSpecifies the location of the html page being inserted
noresizePrevents visitors resizing frames by dragging the borders

Each <frameset> defines a set of rows or cols (columns) with values in pixels or percentages indicating the amount of screen area each row or column will occupy.

In the past, one common application for frames was to have the site navigation in a separate file that was then brought into all the HTML documents using frames. The advantage of course was not having to alter the navigation in all the HTML documents whenever new pages were added. These days this is better accomplished using another web language called PHP (Hypertext Preprocessor). This is a free, open source language that runs on the server side rather than the client side, but for this application is merely a line of code inserted into the web pages that loads in the navigation that is saved in a file with the extension .php.