Advertisement
Google Ad Slot: content-top
Order list
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
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
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
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ol type="i">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Nested Lists:
Ordered lists can be nested inside each other to create sub-lists.
Example
<ol>
<li>Fruit
<ol>
<li>Apples</li>
<li>Bananas</li>
</ol>
</li>
<li>Vegetables
<ol>
<li>Carrots</li>
<li>Broccoli</li>
</ol>
</li>
</ol>