Introduction to HTML : Ordered and unordered lists

Ordered and unordered lists

A list defines a number of connected items rendered one after the other. A list may be ordered or unordered

<ul> element defines an unordered list. An unordered list defines no special sequence.

Example:

<ul>
   <li>Mango</li>
   <li>Orange</li>
   <li>Grape</li>
   <li>Pear</li>
</ul>

Output:

  • Mango
  • Orange
  • Grape
  • Pear

An ordered list on the other hand, specifies a special sequence of list items.

Example:

<ol>
   <li>Mango</li>
   <li>Orange</li>
   <li>Grape</li>
   <li>Pear</li>
</ol>

Output:

  1. Mango
  2. Orange
  3. Grape
  4. Pear

Note that lists may be nested.


course logo
Introduction to HTML
Number of sections:
11
Content length:
Delivery formats: