Back in 1995 Netscape introduced a method of putting more than one html page on the screen at the same time known as frames. Frames soon became all the rage and even Explorer began to support them. When the HTML 4.01 standard was released it contained frames. For a while in the late 90s it seemed everyone was using frames.
But then the worm turned. Frames began to fall out of favor as weaknesses became more evident: for one, it is difficult to bookmark a page in a frameset; creating links to pages within framesets is also a pain. And there are accessibility issues. Today frames tend to be looked-down upon, even scorned by "serious" developers.
Despite this, frames when used wisely still offer advantages over standard html pages. For one, it is easy to create persistent elements (like navigation menus) by placing them in a frame that does not move or change. Frames also make it easier to add new pages or sections to the site—instead of having to add the new links to every single page, they only need be added to a single navigation page.
In this exercise you will create a mini web site using frames.
To begin we'll need a root folder to contain this mini site. Create a folder called famesExercise and put it in your class root folder.
A frameset page looks like a standard html page except it has no <body>. Instead, it has <frameset> tags. So to create a frameset start with a standard html page, but take out the <body> tags. In their place add:
<frameset cols="180, *">
</frameset>
Framesets can be divided into columns, rows (or both). The attribute "cols" defines columns. If you wanted horizontal rows you would use the "rows" attribute. The value of the attributes determine the size of the columns (or rows). In this case "180" means the first column will be 180 pixels wide. The asterisk (*) means "whatever is leftover," so you typically will use that for your final measurement. A three column frameset might look like this: cols="150, 400, *". You can also use percentages in place of pixels, and you can mix and match, so the following is perfectly valid: cols="120, 50%, *".
To create horizontal rows you'd follow the same procedure: rows="140, 40%, *" for example. It is also possible to have both rows and columns in a frameset, but that's a little more complicated. Refer to your HTML text book (p.442) for more information.
<frame src="navigation.html" name="menuColumn" />
<frame src="redPage.html" name="main" />"
The first column/frame will contain the "navigation.html" page and has been given the name "menuColumn." The second column/frame will start with the redPage and has been given the name "main."
<p><a href="redPage.html" target="main">Red Page</a></p>
<p><a href="bluePage.html" target="main">Blue Page</a></p>
<p><a href="greenPage.html" target="main">Green Page</a></p>
<p><a href="yellowPage.html" target="main">Yellow Page</a></p>
10 pts |
Went well above and beyond and created something special. |
9 pts |
Went above and beyond requirements (customized the photos/pages; added styles, etc.). |
8 pts |
Did what was required. |
7 pts |
Missing one or more required elements or contains one or more errors. |
0–6 pts |
Poor showing; mostly incomplete or full of errors. |