Lists in HTML

Let us discuss about the list tag in HTML. 

Lists basically used for listing the given items one-by-one or in a points in unordered and ordered.


Example:

This is the lists perfect example:           
  • Noodles 
  • Chicken rice
  • egg rice 
  • Construct an list using <li> tag.In code write like this <li>egg</li> .We get an output like 
    • egg.
    Through this now we are creating a list with groceries.My mom says 
    • Wheat -1kg   [ Give like as in editor to perform  ,<li>Wheat </li>],
    • Oil-1litre   [<li>Oil</li>],
    • Potato   [<li>Potato</li>].

    Code:

    <!DOCTYPE html>
    <html>
    <head>
         <title>list</title>
    </head>
    <body>
         <li>Noodles</li>
         <li>Chicken rice</li>
         <li>egg rice</li>
    </body>
    </html>


    Output:

    • Noodles.
    • Chicken rice.
    • Egg rice.

    Types of lists:

    1. Unordered lists.
    2. Ordered lists.

    Ordered lists:


        Ordered list creating using <ol> tag.It is used mainly for sequenced steps ,this after you should follow this step .If you not follow the steps your exact food will not good. For example prepare a noodles 

    1. Pour a 1/2 vessel of water.
    2. Boil water for two minutes
    3. Put maggie into the water.
    4. After well boiled put masala.
    5. Close it for two minutes.
          If any steps change in this cause an unsatisfied dish.😑


    Code:

     
    <ol>
            <li>Pour a 1/2 vessel of water.</li>
            <li>Boil water for two minutes</li>
            <li>Put maggie into the water.</li>
            <li>After well boiled put masala.</li>
            <li>Close it for two minutes.</li>
    </ol>


    Unorder lists:

    It is created using <ul> tag. In this we create list without order i.e. you can give first point to last point or last point to first point. In groceries you can give items randomly.
    • Colgate
    • pepsodent
    • Dabur
    • Britania
    If you change the order it gives same items .


    Code:

    <ul>
            <li>Colgate</li>
            <li>pepsodent</li>
            <li>Dabur</li>
            <li>Britania</li>
    </ul>

    Post a Comment

    Post a Comment (0)

    Previous Post Next Post