Section G.10. Nested framesets


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  <?xml version = "1.0" ?>  2  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"  3     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  4  5  <!-- Fig. G.11: index2.html -->  6  <!-- XHTML Frames II        -->  7  8  <html xmlns = "http://www.w3.org/1999/xhtml">  9     <head> 10        <title>Internet and WWW How to Program - Main</title> 11 12        <meta name = "keywords" content = "Webpage, design, 13           XHTML, tutorial, personal, help, index, form, 14           contact, feedback, list, links, frame, deitel" /> 15 16        <meta name = "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     </head> 22 23     <frameset cols = "110,*">                        24        <frame name = "leftframe" src = "nav.html" /> 25 26        <!-- nested framesets are used to change the --> 27        <!-- formatting and layout of the frameset --> 28        <frameset rows = "175,*">                          29           <frame name = "picture" src = "picture.html" /> 30           <frame name = "main" src = "main.html" />       31        </frameset>                                        32 33        <noframes>                                         34           <body> 35              <p>This page uses frames, but your browser does not 36              support them.</p> 37 38              <p>Please, <a href = "nav.html"> follow this link to 39              browse our site without frames</a>.</p> 40           </body> 41        </noframes>                                        42 43     </frameset>                                           44  </html> 

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 in 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 <frame> tag. This practice makes the page clearer and easier to debug.




Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net