W3Newbie
  • HTML Tutorial
  • CSS Tutorial
  • Web Dev
    • VS Code Tutorial
    • Command Line Tutorial
    • Git Tutorial
    • Github Tutorial
    • Sass Tutorial
  • Courses
  • Resources
  • Tutorials
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

HTML Ordered Lists

HTML ordered lists are created using the <ol> tag and are lists of items that have a specific numerical order or sequence. They are three commonly used to present items where the order matters, such as:

  1. Step-by-step, ordered instructions.
  2. Chronologically numbered events or lists like this one!
  3. Top ten lists in articles and blog posts.

Key characteristics of ordered lists:

  • List items: Individual items within the list are defined using the <li> tag, just like in unordered lists.
  • Numbering: Browsers typically display ordered lists with ascending numbers by default (1, 2, 3, etc.) to indicate the item’s position in the sequence.
  • Nesting: Ordered lists can be nested within each other to create multi-level lists with hierarchical structures.
  • Type of numbering: The type attribute can be used to change the numbering style (e.g., type="A" for uppercase letters, type="a" for lowercase letters, type="I" for uppercase Roman numerals, type="i" for lowercase Roman numerals).
  • Starting number: The start attribute can be used to specify the starting number for the list (e.g., start="5" would start the list at 5).
  • Reversed numbering: The reversed attribute can be used to reverse the list (e.g., <ol reversed> for the opening tag would reverse the order).

Ordered List Example with the Type Attribute:

HTML:

<ol type="A"> <!-- This would display A., B., C. instead of a numbered list. -->
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

Ordered List Example with the Start Attribute:

HTML:

<ol start="4"> <!-- This would display 4., 5., 6. instead of 1., 2., 3. -->
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

Ordered List Example with the Reversed Attribute:

HTML:

<ol reversed> <!-- This would display 3., 2., 1. instead of 1., 2., 3. -->
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

Nested Ordered Lists Example:

HTML:

<ol>
  <li>Step 1
    <ol>
      <li>Sub-step 1</li>
      <li>Sub-step 2</li>
    </ol>
  </li>
  <li>Step 2</li>
</ol>

Remember:

  • Use <ul> for unordered lists with bullet points or features like navigations.
  • Combine lists with text and other elements to create more complex content structures.
  • You can apply CSS for further styling, such as custom numbering styles, spacing, alignment, and more.
< Previous
Next Lesson >
  • HTML Tutorial
  • HTML Introduction
  • HTML Text Editor
  • HTML Document
  • HTML Comments
  • HTML Elements
  • HTML Paragraphs
  • HTML Headings
  • HTML Text Formatting
  • HTML Links
  • HTML Images
  • HTML Unordered Lists
  • HTML Ordered Lists
  • HTML Tables
  • HTML Block Elements
  • HTML Inline Elements
  • HTML Attributes
  • HTML Classes
  • HTML IDs
  • HTML Audio
  • HTML Video
  • HTML Divs
  • HTML Semantics
  • HTML Accessibility
  • HTML Forms

The Newbie Template Bundle

The 12 Website Bundle Pack

Subscribe on YouTube

Web Development Courses

The HTML Email Mastery Course - Build Responsive HTML Email Templates.

Latest Tutorial Posts

  • The HTML Email Mastery Course - Build Responsive HTML Email Templates.w3newbie.com
    HTML Email Mastery Course CouponOctober 12, 2020 - 8:10 pm
  • Create A 5 Page Website With PHP Includes, HTML5, CSS3 & Bootstrap 4w3newbie.com
    Create A 5 Page Website With PHP Includes, HTML5, CSS3 & Bootstrap 4April 22, 2019 - 1:48 pm
© w3newbie.com, 2026. Terms of Use. Privacy Policy.
Scroll to top Scroll to top Scroll to top