Ordered list

Ordered list

Ordered lists or numbered lists contain list items each prefaced by a number. We use a numbered list when the order or priority of items is important.

We use two kinds of elements for a numbered list:

  1. The ordered list element (<ol>) specifies a numbered list.
  2. List item elements (<li>) mark each item in the list.

The following markup defines a three-item numbered list:https://stackblitz.com/edit/web-platform-4tzwzz?embed=1&file=index.html&hideDevTools=1&hideExplorer=1&hideNavigation=1

We don’t have to specify a number for each item in a list; the browser identifies list items from the markup and adds numbers, including a period after each one by default.

If you swap the first two items in the list, they’re still numbered in order when the page appears,https://stackblitz.com/edit/web-platform-vpek4b?embed=1&file=index.html&hideDevTools=1&hideExplorer=1&hideNavigation=1