Labs

Lab 4.6: You've Been Framed

In the text we describe frames as a powerful new addition to the HTML language. Frames allow you to manage portions of a page as if they are separate pages (which, as you will see, they are!), altering the contents of one section while leaving another the same. Frames also afford us tremendous flexibility in defining new pages, because we can use previously defined and debugged pages as our building blocks. We use this lab to show you an example of a page composed of frames and then have you apply the technique to your home page.

  1. Look through Rick and Stu's Home Page, both as displayed by your browser and in its HTML code, for evidence of frames and you won't find any. If frames are so powerful and so cool, why haven't we incorporated them into our home page? The answer is that we didn't have to!

In all of the recent lab exercises for this module you've been viewing framed pages. Frames are what allowed us to display and manage the pop-up windows (showing HTML code and a version of our home page) that are common to these pages.

You can get a better appreciation for how these pages have been defined by viewing the source code for the pop-up page that opened in its own window when this page was loaded. Its body is a frameset, which in turn identifies and places two frames within it. Most modern browsers2 allow you to look at the HTML code for the individual frames used to compose a page as well.

Use whatever information is available from your browser to see if you can come up with answers to these questions about this page:

  1. How many framessets are used in defining the pop-up page?
  2. How many frames are contained in each frameset?
  3. What are the names of all of the pages used to compose this page?

  1. We did, in fact, prepare a framed version of Rick and Stu's Home Page for your viewing pleasure - it's the one that popped up in this lab. Check out the source now, and you'll see that we took the main navigation image (which we had originally called "network") and placed it in a separate file from the rest of the original page. We then described the new page as a frameset composed of our two HTML files.

  2. Produce a framed version of your home page now. Put the "table of contents" (or whatever you use to control navigation from the top of your page) in a frame along the left edge of the page. Use the rest of the page to display the contents of individual sections of your home page.

Labs

MODULES:



© 2004 Thomson/Brooks Cole, All Rights Reserved.