G.10. Nested framesets

You can use the frameset element to create more complex layouts in a Web page by nesting framesets, as in Fig. G.11. The nested frameset in this example displays the XHTML documents in Fig. G.7, Fig. G.8 and Fig. G.10.

Figure G.11. Framed Web site with a nested frameset.

1 6 7 8

"http://www.w3.org/1999/xhtml"> 9 10 Internet and WWW How to Program - Main 11 12 "keywords" content = "Webpage, design, 13 XHTML, tutorial, personal, help, index, form, 14 contact, feedback, list, links, frame, deitel" /> 15 16 "description" content = "This Web site will 17 help you learn the basics of XHTML and Web page design 18 through the use of interactive examples 19 and instruction." /> 20 21 22 23 "110,*"> 24 "leftframe" src="nav.html" /> 25 26 27 28 "175,*"> 29 "picture" src="picture.html" /> 30 "main" src="main.html" /> 31 32 33

</span></span> </span> <span>34</span> <span style="color: #000000;"><span><cke:body></span></span> <span>35</span> <span style="color: #000000;"><span><p></span></span>This page uses frames, but your browser does not <span>36</span> support them.<span style="color: #000000;"><span></p></span></span> <span>37</span> <span>38</span> <span style="color: #000000;"><span><p></span></span>Please, <span style="color: #000000;"><span><a data-cke-saved-href =</span href =</span></span> <span style="color: #999999;"><span>"nav.html"</span></span><span style="color: #000000;"><span>></span></span>follow this link to <span>39</span> browse our site without frames<span style="color: #000000;"><span></a></span></span>.<span style="color: #000000;"><span></p></span></span> <span>40</span> <span style="color: #000000;"><span></cke:body></span></span> <span>41</span> <span style="background-color: #CCCCCC;"><span style="color: #000000;"><span>

42 43 44

The outer frameset element (lines 2343) defines two columns. The left frame extends over the first 110 pixels from the left edge of the browser, and the right frame occupies the rest of the window's width. The frame element on line 24 specifies that the document nav.html (Fig. G.10) will be displayed in the left column.

Lines 2831 define a nested frameset element for the second column of the outer frameset. This frameset defines two rows. The first row extends 175 pixels from the top of the browser window, as indicated by rows = "175,*". The second row occupies the remainder of the browser window's height. The frame element at line 29 specifies that the first row of the nested frameset will display picture.html (Fig. G.7). The frame element in line 30 specifies that the second row of the nested frameset will display main.html (Fig. G.8).

Error Prevention Tip G 1

When using nested frameset elements, indent every level of tag. This practice makes the page clearer and easier to debug.

Категории