Problem Statement
Which tag creates a numbered list in HTML?
Explanation
The ol tag is used to create an ordered list in HTML. The ol stands for ordered list. Ordered lists display items with numbers or letters in sequence. Each item is marked with an li tag. By default, browsers number the items starting from 1. Ordered lists are used when the sequence or order of items matters, such as step-by-step instructions, rankings, or procedures. You can customize the numbering style using the type attribute or start attribute. The type attribute can be set to 1 for numbers, A for uppercase letters, a for lowercase letters, I for uppercase Roman numerals, or i for lowercase Roman numerals. The start attribute specifies which number to begin counting from. Ordered lists are semantic elements that help both users and search engines understand that the order is important.
Code Solution
SolutionRead Only
<!-- Basic ordered list --> <ol> <li>First step</li> <li>Second step</li> <li>Third step</li> </ol> <!-- List starting from 5 --> <ol start="5"> <li>Item five</li> <li>Item six</li> <li>Item seven</li> </ol> <!-- List with letters --> <ol type="A"> <li>Option A</li> <li>Option B</li> <li>Option C</li> </ol>
