Chapter 10. Frames

As you start to build bigger and more elaborate Web sites, you’ll no doubt discover one of the royal pains that come with being a Web maven: getting a common element (like a navigation bar) to appear on every page in your site.

For example, you might decide to add a menu of links that let a visitor jump from one section of your Web site to another. You can place these links in a table or a <div> tag (two techniques demonstrated in Chapter 9). However, either way, there’s a problem—in order to show this menu on every page, you’ll need to do a fair bit of copying and pasting. If you’re not careful, one page will end up with a slightly different version of the same menu. And when you decide to make a minor change to the menu, you’ll be faced with the nightmare of updating dozens of pages.

One way to tackle this problem is with frames, a sometimes-controversial HTML feature that lets you show more than one Web page in the same browser window. In this chapter, you’ll learn how to use frames to tame large Web sites.

The Problem with Repeating Content

By this point, you’ve amassed a solid toolkit of Web-page building tactics and tricks. You’ve learned to polish up your Web pages with modern fonts and colors, gussy them up with a trendy layout, and add images and links to the mix. However, as you apply these techniques to a complete Web site, you’ll run into some new challenges.

One of the first consequences you’ll face when you go from one Web page to a dozen is how to make ...

Get Creating Web Sites: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.