Web hosting servers - 1422 Introduction to HyperText Markup Language 4: Part
1422 Introduction to HyperText Markup Language 4: Part 2 Appendix J els or as a percentage of the screen. In this case, the attribute cols = “110,*” tells the browser that there are two frames. The first one extends 110 pixels from the left edge of the screen, and the second frame fills the remainder of the screen (as indicated by the asterisk). Now that we have defined the page layout, we have to specify what files will make up the frameset. We do this with the frame element in lines 25 and 26: In each frame element, the src attribute gives the URL of the page that will be displayed in the frame. In the preceding example, the first frame (which covers 110 pixels on the left side of the frameset) will display the page nav.html and has the attribute name = “nav”. The second frame will display the page main.html and has the attribute name =”main”. The purpose of a name attribute in the frame element is to identify the frame, enabling hyperlinks in a frameset to load in their intended target frame. For example, would load links.html in the frame whose name attribute is “main”. A target in an anchor element can also be set to a number of preset values: target=”_blank” loads the page in a new blank browser window, target=”_self” loads the page into the same window as the anchor element, target=”_parent” loads it in the parent frameset (i.e., the frameset which contains the current frame) and target=”_top” loads the page into the full browser window (the page loads over the frameset). In lines 28 38 of the code example in Fig. J.9, the noframes element displays HTML in those browsers that do not support frames. No Portability Tip J.1 Not everyone uses a browser that supports frames. Use the noframes element inside the frameset to direct users to a nonframed version of your site. Look-and-Feel Observation J.3 Frames are capable of enhancing your page, but are often misused. Never use frames to accomplish what you could with other, simpler HTML formatting. J.10 Nested framesets You can use the frameset element to create more complex layouts in a framed Web site by nesting frameset areas as in Fig. J.10. The first level of frameset tags is on lines 21 and 22