How do you create a numbered list in HTML 5 ?
Last Updated :
23 Jan, 2024
To create a numbered list in HTML, you use the <ol>
(Ordered List) element. Inside the <ol>
element, you use <li>
(List Item) elements to define each item in the list. Here,
<ol>
represents the ordered list container.
<li>
represents each list item.
Syntax
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Example: Implementation to create a numbering list in HTML.
HTML
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "UTF-8" >
< meta name = "viewport"
content = "width=device-width, initial-scale=1.0" >
< title >Numbering</ title >
</ head >
< body >
< ol >
< li >First item</ li >
< li >Second item</ li >
< li >Third item</ li >
</ ol >
</ body >
</ html >
|
Output:
Share your thoughts in the comments
Please Login to comment...