=========================================================================== Today on The World Vol. 4 #170 Wednesday, July 1, 1998 =========================================================================== Only two more installments of the HTML tutorial left -- this one (frames) and then the wrap-up installment. Now's your chance to ask questions or request clarification of anything -- please post to wstd.html if you have a question you would like me to consider for the final chapter. Remember that you can find the other chapters on http://world.std.com/help/web/tutorial for now. (kibo) --------------------------------------------------------------------------- HTML TUTORIAL -- CHAPTER 15 -- FRAMES 15.1 Frames -- the rationale Frames, invented by Netscape Inc. and now supported by the major browsers (Netscape Navigator, Microsoft Internet Explorer, even lynx and WebTV) are a way of dividing a web page up into sections, much like tables. The difference is that with frames, each section is a separate .html file -- each frame is effectively an independent page. A table is a single document containing all the cells (and certain tags should not be used inside the cells) whereas within frames, "anything goes". One of the best features of frames is that they can scroll independently. For instance, you could have two frames, one of which contains a small navigation bar (set of links) and doesn't scroll, while the rest of the window is a large scrolling area for the site's text. Frames can be hard to navigate in some browsers (many browsers do odd things when "Back" button is pressed while you're at a framed site, and it can be hard to bookmark a particular location within a framed site) and some people get confused by framed sites. Because of this, some people will disable frames support in their Web browser (usually this can be turned off in "Preferences" or "Options") and some Web designers do not design with frames. (There used to be a "Campaign Against Frames" site discouraging people from using frames, but it seems to have disappeared. Maybe the Netscape Mafia rubbed 'em out.) Frames are a powerful tool when used correctly, however, they can also make your site appear unnecessarily complicated if you use them without good reason. More importantly, if you don't use them correctly, you can easily create a malfunctioning site. 15.2 How frames work -- general structure Every Web site that uses frames requires at least three documents: First, the "frameset" document which describes the relationship of the different panes (but contains no actual content), and second, two or more regular .html files which are displayed in the panes. (I suppose you could make a framed site with only two documents if you only had one pane, but that would be pointless.) The frameset document -- which would normally be index.html so that it gets loaded as the first page people see when they come to your site -- differs from a normal .html file in that it has no
... section. Here's the skeleton of a framed index.html: