|
Drawbacks of using frames
There are disadvantages to using frames in your web page beyond visual appearance.
Multiple HTML pages
A page that uses frames will most likely contain roughly three frames. In the above example, the rowing page consists of three frames. One thin frame on the side that contains a scrolling menu, one frame that runs along the top that contains the logo and title of the Web site, and one large frame that takes up the rest of the page and contains the main content. Each of these frames is an independent HTML page. They all work together on the page through the use of one or more framesets, which is an HTML page that defines the structure and properties for the Web page, including information about the number of frames displayed on a page, the size of the frames, the source of the page loaded into a frame, and other definable properties. The frameset page isn't displayed in a browser; it simply stores information about how the frames on a page will display. (It is the page you should preview when you use Preview in Browser, however.).
The rowing page example also utilizes nested frames, which means that there is a second frameset within the first. In this case, the navigation frame and the main content frame are within a frameset. That frameset is within the overall frameset, which contains the top logo/title frame and the bottom frameset.
The disadvantage is that you have to keep track of all these individual HTML pages, as well as the frameset pages.
Saving frame-based Web sites
Also, a common problem users run into is with saving. You must save every single HTML page and every frameset page, or your frames will not work at all.
To save a frameset file:
| 1 |
Select the frameset in the Frames panel or the Document window. |
| 2 |
Choose one of the following: |
 |
To save the frameset file, choose File > Save Frameset. |
 |
To save the frameset file as a new file, choose File > Save Frameset As. |
 |
|
To save a document that is inside a frame:
Click in the frame to select it, then choose File > Save Frame or File > Save Frame As.
To save all files in a frameset:
Choose File > Save All Frames.
This saves all open documents, including individual documents, frame documents, and frameset documents.
Note: Use the frame selection lines in the Document window to help you identify frameset and frame documents as you are saving files.
Formatting frames
You have to format each frame in your page. You can format all of the frames and framesets in your page through the Property inspector. You can set scrolling on or off, set width and height, name each page, and more.
It is important to set properties for your frames, especially naming each one. The names are used when you add links to your page.
Linking in frames
To use links in frames, you must set a target for the link. The target is the frame in which the linked content will open. For example, if the navigation menu is in the left frame, and you want the linked material to appear in the main content frame, you must use targets for all the navigation menu links. The target will be the name of the main content framefor example, main_frame. When a user clicks a a navigation link, the content will open in the main frame.
To select a frame in which to open a file, you use the Target pop-up menu in the Property inspector. You can set a file to open in a new frame, replace information in the same frame as the link, or replace information in another frame. You can also cause the linked content to overwrite the current frame (by not choosing a target) or to appear in an entirely new browser window.
To target a frame:
| 1 |
Select text or an object. |
| 2 |
In the Link field of the Property inspector, do one of the following: |
 |
Type the name of the file to link to. |
 |
Click the folder icon and select the file to link to. |
 |
Click and drag the Point to File icon to select the file to link to. |
|
To specify an anchor (specific place) in the file to link to, enter a number sign (#) before the anchor name. See Linking to a specific place within a document. |
| 3 |
In the Target pop-up menu, choose the location in which the linked document should appear. |
 |
If you named your frames in the Property inspector, the frame names appear in this menu. Select a named frame to open the linked document in that frame. |
 |
_blank opens the linked document in a new browser window and keeps the current window available. |
 |
_parent opens the linked document in the parent frameset of the link. |
 |
_self opens the link in the current frame, replacing the content in that frame. |
 |
_top opens the link in the outermost frameset of the current document, replacing all frames. |
 |
|
|