Share this Page URL

Chapter 13. Fooling Around with Frames > Forging a Frameset Page - Pg. 145

Fooling Around with Frames 145 Figure 13.3. This version of the page mysteriously displays the navigation stuff in its own section at the top of the page. To perform this magic trick, I had to do three things: · I grabbed the HTML tags and text that make up my navigation section, and I put it all into a separate file called header.html. · I grabbed the rest of the page text and put it into another file called beach-f.html. · I created a third page called beach2.html that has a few special tags that serve to divide the browser window into two frames . I included in this page the instructions to load the header.html file into the top frame, and the beach-f.html file into the bottom frame. The big deal is that with this view, surfers can scroll through beach-f.html in the bottom frame until they're blue in the face, and the navigation section remains steadfastly in place. It's even possible to arrange things so that if you click any link, the new page appears in the bottom frame. In other words, the top frame is really the web equivalent of picture-in-picture! Okay, now that you know what frames are and why you might want to bother with them, let's see how you go about constructing them. Forging a Frameset Page The good news about frames is that you can build them using just a few not-too-hard-to-master HTML tags. Unfortunately, most frame neophytes get thrown for a loop right off the bat because the first thing you have to create is a web page that doesn't display anything! Huh? Let me explain. After you enter the frames world, you're faced with not one, but two species of web page: · Content pages--A content page is just a regular HTML page like the ones you've dealt with throughout this book. That is, they display text, graphics, and whatever other goodies the author packs into the page. · Frameset pages--A frameset page has only one mission in life: to divide the browser window into a set of frames, define the size of each frame, and specify which content pages are displayed in each frame. Note that (as you'll soon see) frameset pages have no body section, so you shouldn't populate a frameset page with anything that would normally appear in the body, in- cluding regular text and HTML tags such as <B> and <IMG>. If you try, the browser simply ignores your efforts completely and concentrates solely on the frame information.