How Frames Work


How Frames Work

When you look at a framed site, you are actually seeing multiple pages ( Figure 11.1 ). You've seen the site in Figure 11.1 before, but not in frames. At first glance you might not notice the site is framed. But once you start scrolling you'll realize the difference. Notice the scrollbar in Figure 11.1. See how it starts about halfway down the side of the page? That's because there are actually three framed pages shown, and only the frame on the lower right has a scrollbar.

Figure 11.1. The HomeCook. info site in a framed layout looks much like the other layout.


The arrangement of the individual frames is determined by the frameset document . The frameset document contains one or more frameset tags, which set up the number of frames, how they will be arranged, and which individual Web pages will be displayed when the page is opened for the first time.

No matter how many frames a browser window displays, there is usually only one frameset document for a site. A Web page with three frames actually needs four separate documents to display correctly: the frameset document and the three individual documents that fill the three frames.

A frameset divides a window into either columns or rows, but not both at once. Luckily, framesets can be nested , or put one inside another. A frameset of columns can be nested in a row of another frameset. Or, a frameset of rows can be nested in a column of another frameset. In Figure 11.1, the frameset has two rows. The top row holds the site identification. The bottom row splits into two columns with a nested frameset. One column holds the navigation, and the other holds the content. The content frame is the one with the scrollbar.

The frameset document is invisible to the user. It sets up the arrangement of the visible pages shown in the frames. The user sees the results of the frameset document, but not the actual frameset document itself.

But wait, there's an accessibility issue. Not all browsers work with framesets. Therefore, each frameset document contains a noframes section. Use the noframes section to provide basic information in case the user's browser cannot display frames. Links to your content pages are an example of good information to include in a noframes section. That way every user can find your valuable content.

Dreamweaver lets you set up the frameset and then work on the individual Web pages for the frames separately. Or you can work on the individual Web pages while they are displayed in the frameset. Both are perfectly valid choices; for instance, an individual might manage a site with only a few pages inside the frameset, while a larger site might have numerous people handling different content pages.

Should You Use Frames?

Using frames is often a poor choice for layout. Although frames do have some advantages, they're outweighed by the disadvantages, to the point that few professional/commercial sites now use frames. For every advantage of frames, there are usually ways to achieve the same effect without frames.

The most common reason for using frames is navigation. A navigation bar displayed in a frame is always visible no matter how much you scroll in other frames.

Some disadvantages of using frames are:

  • Not all browsers provide good frame support. Cellphone browsers, PDA browsers, and browsers for users with disabilities have problems with frames. A noframes section helps, but it's a poor substitute for the good browsing experience you hope users have at your site.

  • It's not possible to bookmark framed pages. The URL of a framed page doesn't appear in the browser's address bar.

  • It's difficult to get graphic elements to line up precisely between frames.

  • Testing the navigation is time-consuming .

  • Search engines may not be able to properly navigate and index a framed site.

  • Visitors who come to your site via search engines will load an unframed page, as search engines will send visitors to your content pages and skip your navigation. To work around that requires some way to get to the "real" versionthe content page they want, inside the proper frameset.

Some advantages of using frames are:

  • Static frames such as navigation bars or graphical banners don't have to be reloaded each time the content changes, making your site load faster.

  • Each frame has its own scrollbar and can be scrolled individually.

Sometimes frames are the best layout choice in spite of their disadvantages. When that is the case, be extra careful to:

  • Provide helpful noframes content, such as a list (with links) of your content pages.

  • Use the title attribute to give each frame a descriptive name . This helps with frame identification and navigation. See Creating a Frameset for details.

  • Provide a friendly way for visitors arriving from a search engine to get into your framed site.





Macromedia Dreamweaver 8 for Windows & Macintosh Visual QuickStart Guide
Macromedia Dreamweaver 8 for Windows & Macintosh
ISBN: 0321350278
EAN: 2147483647
Year: 2005
Pages: 239

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net