Frames: the Designer Perspective |
|
| Overview |
The purpose of the frameset page is to control the layout of the normal pages. At least two normal pages are needed, but more are possible. |
| Multi-frame
Options |
When a more complex arrangement of windows is wanted, it may be necessary to have more than one frameset page. This is particularly true whenever rows have different numbers of columns, or columns have different numbers of rows, as in the illustration below.
The ability to nest frames in this manner gives us a great deal of flexibility. The nested framesets can be in the same file as well, which reduces the number of files used. |
Frames: Coding |
||
| The
Frameset Tag |
The <frameset> tag is used in frameset pages instead of a <body> tag. (So frameset pages are the exception to the rule that all HTML pages have a Head and a Body.) The <frameset> tag itself contains directions for positioning the frames in the page; it also encloses the <frame> tags. But let's look first at the information in the <frameset> tag itself:
The size of rows and columns can be either in pixels or percent - numbers
by themselves (as in These are optional:
In this simple example, we create a window with two horizontal frames, the top one 64 pixels high, the next taking up the rest of the browser window:
|
|
| The
Frame Tag |
Between <frameset> and </frameset> there need to be <frame> tags that tell the browser where to get the pages to put in each code, and what to call them. Each <frame> tag should have:
Here's a minimal frame tag:
Ordinarily, a browser provides two services for the user of a page with frames:
Here's a frame tag with these options set:
|
|
| The
Noframes Section |
Occasionally, users with older browsers come along and can't see the framed pages. HTML provides the <noframes> tag to allow us to put in something for those who can't see frames with their browsers. The <noframes> tag is put right after the </frameset> tag. At the end of the Noframes section, put a </noframes> tag to close it properly. The Noframes section can contain anything you feel would help to get the information to users who can't see frames. There's an example in the next section. It is generally not helpful to state that the user should get a browser that can handle frames. Usually, there is a reason why someone has a no-frames browser. Though most users have frames-enabled browsers, it is often the case that visually impaired users with simple-text browsers and text-to-speech software will have difficulty with frames. So even though it seems unlikely that anyone would still have a browser that can't handle frames, including a Noframes section allows better access to the disabled. |
|
| Complete
Example |
Let's put all the pieces together by showing a simple frameset file:
In order for a frameset to work, it is necessary for the Web coder/author to create all the files referred to (unless they are created by others). In this case, the coder/author needs to create w25c_head.htm and w25c_body.htm. |
|
About This Document |
|
| Review |
Click here |
| Audience
and Objectives |
This module is for people who are familiar with the fundamentals of HTML including links (see module W23c), and want to learn how to construct pages with frames. |
|
On successful completion of this module, you will be able to:
|
|
| Module W25c: | This document is part of a modular instruction series in Computer Instruction. For more information, see the overview or the list of modules in this series, W: World Wide Web. This document has been used in the following classes: INP 150. |
| History: | Original: 2 December 2002 Last modification: Monday, 31-Aug-2009 11:48:06 EDT |
| Copyright | Copyright
© 2003, Laurence J. Krieg,
Washtenaw Community CollegeInstructors: You may pint to this file in your Web-based materials; however, its location may change without notice. Students: You are welcome to make a copy for your personal use. All other uses: Please contact the author, Laurence J. Krieg, for permission: krieg@ieee.org. |