Horje
How do you create a numbered list in HTML 5 ?

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:

Screenshot-2024-01-23-163413



Reffered: https://www.geeksforgeeks.org


HTML

Related
Explain the difference between head Tag and header Tag in HTML5 ? Explain the difference between head Tag and header Tag in HTML5 ?
HTML Table Borders HTML Table Borders
Browser Object Model Browser Object Model
HTML Link Colors HTML Link Colors
HTML Head Element HTML Head Element

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
17