| <html>
<head>
<title>Frames Demo</title>
</head>
<frameset cols="40%,60%">
<frameset rows="30%,70%">
<frame src="Frame1.html">
<frame src="Frame2.html">
</frameset>
<frameset rows="25%,25%,25%,25%">
<frame src="Frame3.html">
<frame src="Frame4.html">
<frame src="Frame5.html">
<frame src="Frame6.html">
</frameset>
</frameset>
</html>
|
Here's what happened.
- After the opening paired tags, the opening frameset tag divides the screen into two columns. The left hand column is allotted 40% of the available screen and the righthand column gets the remaining 60%. The same instructions could also be given with the following markup:
<frameset="40%,*">
Notice that there is no body tag in a frameset document.
- Immediately following the opening frameset, a second framesetis opened and two rows are specified. This is done with a nested frameset which splits the lefthand column into two rows, or windows, the first (the top row) taking 30% of the column and the second, the bottom row taking 70% of the space.
What follows is markup, explained below, that instructs a browser to display specific pages in the windows that we have just created. Since we defined two windows, we need two pages to fill those windows. In this example, we have created two pages called Frame1.html and Frame2.html. These pages are not part of the frameset - they are separate web pages, fully marked up, in our <www> directory.
We must do this because the frameset is an empty document. Its purpose is merely to divide the screen. We must then fill it with content. Placing the names of the pages in the frameset allows the browser to find the content to place into the appropriate frames
- Once the frames have been filled with content, the nested frameset must be closed.
- Next, the righthand column is divided into four rows or windows, which requires that we open a second nested frameset. Each window is allotted 25% of the column Again, each window must have a page associated with it, so four more pages were marked up:
| Frame3.html |
Frame4.html |
Frame5.html |
Frame6.html |
- Once this frameset has been filled with content, it too must be closed.
- Finally, the opening frameset must be closed.
|