Advertisement

Google Ad Slot: content-top

Order list

~1 min read · HTML
On this page

In HTML, you can create an ordered list (numbered list) using the <ol> element. Inside the <ol>, each list item is defined using the <li> (list item) element. Here's an example:

Basic Structure
  1. First item
  2. Second item
  3. Third item
Try it yourself

Common list-style-type Values:

Attribute Value
Description
type="A"
Uppercase letters
type="a"
Lowercase letters
type="I"
Roman numerals
type="i"
Lowercase Roman numerals

Example
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
Try it yourself

Nested Lists:

Ordered lists can be nested inside each other to create sub-lists.

Example
  1. Fruit
    1. Apples
    2. Bananas
  2. Vegetables
    1. Carrots
    2. Broccoli
Try it yourself