HTML Course

Ordered list

Go back

You can use ol to create an ordered list, or ul to create an unordered list. Each item is inside a tag li. You can nest a list inside another, simply by writing another ul/ol inside a tag li.

<ol>
    <li>one</li>
    <li>two</li>
    <li>...</li>
</ol>

<ol>
    <li>one</li>
    <li>two
        <ul>
            <li>...</li>
            <li>...</li>
        </ul>
    </li>
</ol>

Note: Simply replace ol by ul to make an ordered list.


Result of the code above

  1. one
  2. two
  3. ...
  1. one
  2. two
    • ...
    • ...

Notes

You can add the attribute start="n" for ordered lists, which is start="1" by default.

You can only change the style of a list (i.ii.iii, I.II.III, A.B.C., a.b.c.) using CSS, as the attribute type is deprecated.

You can reverse a list with rev or reversed (both are working, but you should use the later).