Differentiate between an Ordered list and an Unordered list?

An unordered list uses <ul> </ul> tags and each element of the list is written between <li> </li> tags. The list items are displayed as bullets rather than numbers.

An ordered list uses <ol> </ol> tags and each element of the list is written between <li> </li> tags. The list items are displayed as numbers rather than bullet points.

<!DOCTYPE html>

<html>

  <body>

    <h2>HTML List Example</h2>

    <ul>

      <li>Coffee</li>

      <li>Tea</li>

      <li>Milk</li>

    </ul>

    <ol>

      <li>Coffee</li>

      <li>Tea</li>

      <li>Milk</li>

    </ol>

  </body>

</html>


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *