Section F.10. Nested and Ordered Lists


F.10. Nested and Ordered Lists

Lists may be nested to represent hierarchical relationships, as in an outline format. Figure F.11 demonstrates nested lists and ordered lists. The ordered list element ol creates a list in which each item begins with a number.

Figure F.11. Nested and ordered lists in XHTML.

  1  <?xml version = "1.0" ?>  2  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  3     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">  4  5  <!-- Fig. F.11: list.html               -->  6  <!-- Advanced Lists: nested and ordered -->  7  8  <html xmlns = "http://www.w3.org/1999/xhtml">  9     <head> 10        <title>Internet and WWW How to Program - Lists</title> 11     </head> 12 13     <body> 14 15        <h1>The Best Features of the Internet </h1> 16 17        <!-- create an unordered list --> 18        <ul> 19           <li>You can meet new people from countries around 20              the world.</li> 21           <li> 22              You have access to new media as it becomes public: 23 24              <!-- this starts a nested list, which uses a --> 25              <!-- modified bullet. The list ends when you --> 26              <!-- close the <ul> tag.               --> 27              <ul> 28                 <li>New games </li> 29                 <li>                        30                    New applications         31 32                    <!-- nested ordered list --> 33                    <ol>                     34                       <li>For business</li> 35                       <li>For pleasure </li> 36                    </ol>                     37                 </li>                        38 39                 <li>Around the clock news</li> 40                 <li>Search engines </li> 41                 <li>Shopping</li> 42                 <li>                         43                    Programming               44 45                    <!-- another nested ordered list --> 46                 <ol>                         47                    <li>XML</li>              48                    <li>Java </li>            49                    <li>XHTML</li>            50                    <li>Scripts</li>          51                    <li>New languages </li>   52                 </ol>                        53 54                 </li>                        55 56              </ul> <!-- ends the nested list of line 27 --> 57           </li> 58 59           <li>Links </li> 60           <li>Keeping in touch with old friends </li> 61           <li>It is the technology of the future!</li> 62 63        </ul> <!-- ends the unordered list of line 18 --> 64 65     </body> 66  </html> 

A Web browser indents each nested list to indicate a hierarchical relationship. The first ordered list begins at line 33. Items in an ordered list are enumerated one, two, three and so on. Nested ordered lists are enumerated in the same manner. The items in the outermost unordered list (line 18) are preceded by discs. List items nested inside the unordered list of line 18 are preceded by circles. Although not demonstrated in this example, subsequent nested list items are preceded by squares.



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