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 6 7 8

"http://www.w3.org/1999/xhtml"> 9 10 Internet and WWW How to Program - Lists 11 12 13 14 15

The Best Features of the Internet

16 17 18

  • 19
    • You can meet new people from countries around 20 the world.
    • 21
      • 22 You have access to new media as it becomes public: 23 24 25 26 27
        • 28
          • New games
          • 29
            • 30 New applications 31 32 33
              1. 34
                • For business
                35
                • For pleasure
                • 36

              37

            • 38 39
              • Around the clock news
              • 40
                • Search engines
                • 41
                  • Shopping
                  • 42
                    • 43 Programming 44 45 46
                      1. 47
                        • XML
                        • 48
                          • Java
                          • 49
                            • XHTML
                            • 50
                              • Scripts
                              • 51
                                • New languages
                                • 52

                      53 54

                    • 55 56
                    57
                  • 58 59
                    • Links
                    • 60
                      • Keeping in touch with old friends
                      • 61
                        • It is the technology of the future!
                        • 62 63
                        64 65 66

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.

Категории