How to make frames pt 2


So we have our three pages, called head.html, menu.html and frameshow1.html, and in this lesson we will be fastening them together. To do this we need two (sadly now deprecated) HTML tags called <FRAMESET> and <FRAME>.

This is the code I have used.

<!DOCTYPE html>
<html>

<frameset rows="15%,*" border=0>
<frame src="head.html" name="head">
<frameset cols="15%,*" border=0>
<frame src="menu.html" name="menu">
<frame src="frameshow1.html" name="main">
</frameset>
</frameset>

</HTML>
This is an example of a "nested" frameset, with one frame set inside another. The first frameset is described by the first line of the code in the main block. <FRAMESET> takes a number of attributes:


Next I use the <FRAME> tage to give my browser details about what I want displayed in the first frame. Again, it takes attributes as follows:

The browser would expect another <FRAME> tag after the first one. Instead, I've given it another frameset, which it interprets in the same way as above (the first column - note the COLS attribute - being 15% of the total available space, and the rest being empty. I've then specified two other frames, the first being the 15% sized one ("menu.html","menu") and the last being the remainder ("main.html","main"). I then close the two <FRAMESET> tags (you don't need to close <FRAME> tags!).

<-previous | next->