80 likes | 222 Vues
Explore the two main types of lists in XHTML: ordered and unordered lists. Ordered lists are used for sequences or preferences and are formatted with numbers or letters, perfect for instructions like recipe steps. In contrast, unordered lists feature items without a specific order, utilizing bullet points or symbols. Discover how to implement these lists with XHTML markup and see practical examples, such as listing favorite books or structuring a term paper with nested lists. Learn the advantages of using lists in HTML to enhance readability and organization.
E N D
Two main types of lists Ordered Lists • sequences (e.g. the steps in a recipe) or preferences • carry numbers (Arabic or Latin) or letters Example: • first step • second step • third step Unordered Lists • items that do not have a natural order (e.g. the ingredients in a recipe) • carry bullet points, symbols or dashes Example: • first item • second item • third item
XHTML Markup Source Code: Result in thebrowser: first item second item third item <ol> <li>first item</li> <li>second item</li> <li>third item</li> </ol>
Advantages • numberingisdoneautomatically: Myfavouritebooks: • Alice in Wonderland • Peter Pan • Lord ofthe Rings Harry Potter
Advantages Source Code: <ol> <li>Alice in Wonderland</li> <li>Harry Potter</li> <li>Peter Pan</li> <li>Lord oftheRings</li> </ol>
The newlist: Myfavouritebooks: • Alice in Wonderland • Harry Potter • Peter Pan • Lord ofthe Rings
Nested Lists Writing a term paper: Source code: <ol> <li>Finding a topic</li> <li>Collectingliterature <ul> <li>fromthelibrary</li> <li>fromtheinternet</li> </ul> </li> <li>Writing thetext</li> </ol> • Finding a topic • Collecting literature • from the library • from the internet • Writing the text