Example for orderd list |HTML|

Introduction

    In HTML, an ordered list is a way to display a list of items in a sequentially numbered format. It's represented by the <ol> tag. Each item within the list is defined using the <li> (list item) tag. Ordered lists are typically used when the order of the items is significant or needs to be displayed in a specific sequence.


Code

    
     
    <html>
    <head>
        <title>Exploring Unordered Lists</title>
    </head>
    <body>
        <h2>Fruits</h2>
        <ol>
        <li>Apple</li>
        <li>Orange</li>
        <li>Banana</li>
        <li>Grapes</li>
        </ol>
    </body>
    </html>
        
       
     


Output




In this example 
1. The <ol> tag defines the start of the unordered list.
2. Each <li> tag represents an item within the list.
3. The content inside each <li> tag is the text of the item.

    When rendered in a web browser, this HTML code will display the list of fruits with numbers preceding each item, indicating that it's an ordered list. The numbers signify the order of the items, starting from 1 and increasing sequentially.

Conclusion

   Ordered lists (<ol> in HTML) are useful for presenting items in a specific sequence or order, where the order holds significance. They're commonly used for step-by-step instructions, ranking or prioritizing items, presenting sequential data like timelines or schedules, outlining legal or regulatory requirements, structuring survey questions, and occasionally for navigation menus with hierarchical structures. Overall, they enhance clarity and guide users through content logically.

Post a Comment

0 Comments