HTML Tutorial

HTML Tag: <ol>

Usage of <ol>:

The <ol> tag creates an ordered list, where each item is represented by a number or letter.

Attributes of <ol>:

  • type: Specifies the type of numbering (e.g., "1", "a", "A", "i", "I").
  • start: Sets the starting number or letter for the first item.
  • reversed: Reverses the ordering of the list items.

Examples with <ol>:

  • Ordered list with numbers:
<ol>
  <li>Item 1</li>
  <li>Item 2</li>
</ol>
  • Ordered list with letters:
<ol type="a">
  <li>Item A</li>
  <li>Item B</li>
</ol>

Simple HTML Example: Exploring the <ol> Tag

<!DOCTYPE html>
<html>
<head>
  <title>Ordered List Example</title>
</head>
<body>
  <h1>Ordered List</h1>
  <ol>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
  </ol>
</body>
</html>