Frames
Avoid using frames

Frames should be avoided because of the usability problems they create. Frames-based pages behave differently from standard Web pages, affecting essential Web functions such as printing, bookmarking, and navigation. General usability suffers when functions do not behave as users expect.

For example, printing a frames-based page can produce unpleasant results. The browser prints the contents of the frame that has focus when the print function is invoked, which may not be the desired outcome if it’s the navigation or site banner frame.

In addition, functions that involve addressing, such as bookmarking, do not work well when frames are in use. The actual file at the URL location of a frames-based page is called a frameset, which contains references to one or more Web pages (Figure 7.1). When a user clicks a link and loads a new page in a frame within a frameset, the URL within that frame changes, but the frameset URL remains the same. If the user chooses to create a bookmark to the page in its current state, the bookmark captures the URL of the frameset’s original links rather than the current state the user is viewing.

Figure 7.1: NextD Journal screenshot

Figure 7.1: Frame-based pages are composed of different Web pages loaded into separate frames. NextD uses frames to divide the page into three sections: the top frame for branding and site navigation (1), the left frame for section navigation (2), and the right frame for content (3). www.nextd.org

Another usability concern is the unexpected behavior of the back button. When frames are used, going back moves the user back in the frame rather than back a page. This can cause confusion if the user thinks of the frameset as a page and expects the back button to go back to the previous page.

Add to these usability flaws concerns directly related to access, and frames become an even less attractive design solution. Since frames-based pages are a pairing of two or more pages, users need to be able to identify the function of each frame and to navigate between frames. Nonvisual users cannot access the visual cues that help visual users differentiate frames and identify their functions. If frames are not described in the frameset code, nonvisual users cannot easily determine the function of each frame, nor can they navigate between frames. In addition, users can opt not to view frames, or they can use a browser that does not support the display of frames. These users will not have access to site content unless access is provided via the fallback NOFRAMES tag.

In general, the accessibility concerns associated with frames can be addressed using proper markup. However, even if users can access the content in a frames-based Web site, they will encounter the usability flaws inherent to frames. For this reason, frames should be avoided as a tool for Web site design.