• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 7. Frames > Creating Frames

7.2. Creating Frames

Before you begin creating frames, think about how they might best serve your Web site's structure. For instance, if you want a banner with the Web site's logo or name to appear at the top of each page, you could create a frame at the top to hold it. Or, to help your visitors get around, you might include a navigation bar in a frame at the left of the page consisting of a list of links to the site's main sections.

When Frames Aren't the Best Solution

Frames are useful for banner logos, navigation bars, and so on. But if you look around, you'll notice that not many big-time Web sites use them. The reason: frames have serious drawbacks.

First, bookmarks and favorites don't always work with frames. When you click a link inside a frame, a new page loads inside it; if you click a link on that page, yet another page will load. Although it looks as if you are on a different page, the URL in the Address bar remains unchanged. That's because a Web browser uses the address of the frameset page.

In other words, suppose you follow several links within a single frame, and then use your browser's Add Bookmark or Add to Favorites command. Later, when you select the bookmark or favorite, you'll see the frameset page and the original pages inside it—you won't see the page you wound up on.

Printing a Web page with frames can be tricky, too. Since a frames-based page is composed of multiple Web pages, the browser doesn't know which page you want to print. Different browsers handle this dilemma so differently, novice Web surfers who don't understand the frames concept may get confused. For example, if you're using the Mac version of Internet Explorer 5 to view the second page in Figure 7-2, and you click one of the navigation buttons in the top frame, Internet Explorer thinks you've selected that frame. If you then choose Edit→Print, you'll print only that top frame—a useless row of buttons!

Figure 7-2. Frames can be obvious and ugly, or subtle and effective. Top: This fictional Web page has five frames. Notice the thick border between the frames and the unnecessary scroll bars that appear in the banner and sidebar Bottom: This page (http://bmrc.berkeley.edu/resources/) has three frames, but with borders turned off, the frames merge into a unified presentation. Only a single scroll bar appears in the content area (middle frame) of the page. This is your only clue that this page uses frames. In this example, the advantage of using frames is that the site log and navigation (top frame) and the site tools (bottom frame) always remain visible even if you scroll to read the text contained in the middle frame.

Still, used in moderation and in good taste (see Figure 7-2), frames can be an excellent addition to your bag of Web tricks. Small sites, where users aren't likely to print or bookmark the pages, can make good use of frames. And you needn't use frames everywhere on a site. You can effectively create small presentations within a site—such as an online portfolio—that benefit creatively from frames.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint