HTML Ordered List
An ordered list in HTML is used to display items in a numerical sequence. Learn how to create an ordered list in HTML.
An ordered list uses numbers or other types of markers to indicate the sequence of items. It's ideal for listing steps in a process or ranking items in order of importance. In this tutorial, we will learn how to create an ordered list in HTML.
Key Points
- Ordered lists are used for items that follow a sequence.
- They are created using the
<ol>(Ordered List) tag. - List items are enclosed within
<li>(List Item) tags.
Syntax of an Ordered List
<ol>
<li>Mango</li>
<li>Orange</li>
<li>Litchi</li>
</ol>Output of an Ordered List
1. Mango
2. Orange
3. LitchiSetting the 'type' Attribute
The type attribute specifies the style of numbering. You have several options:
- Uppercase Roman Numerals: Use type="I"
- Lowercase Roman Numerals: Use type="i"
- Arabic Numerals: Use type="1" (This is the default if the type attribute is not specified)
- Lowercase Alphabetical Letters: Use type="a"
- Uppercase Alphabetical Letters: Use type="A"
Setting the 'start' Attribute
<ol type="A" start="3">
<li>Pen</li>
<li>Pencil</li>
</ol>Output
C. Pen
D. PencilConclusion
In this tutorial, we learned how to create an ordered list in HTML. We also explored how to customize the numbering style using the type and start attributes.
How is this guide?
Sign in to share your feedback
Help us improve by sharing your thoughts on this guide.
Last updated on
HTML Definition List
An HTML definition list is used to display items in a dictionary-like format. Learn how to create a definition list in HTML.
HTML Lists
HTML lists are used to organize and display content in a structured manner. Learn how to create ordered, unordered, and description lists in HTML.