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.
<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">
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:
- ROWS tells the browser that you want horizontal frames, the first being 15% of the available screen space, and the second being all the remaining space.
- I've used BORDER=0 to say I don't want a border. Try BORDER=1 and see what a border looks like. Then go back to BORDER=0. :-)
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:
- SRC means "source". This tells the browser where the page that I want to display in that frame (in this case "head.html") lives.
- NAME gives the frame a name. This is important so I can tell links to put another page in that frame if I want to. I've called it "head".
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->