Uncheck "normalize CSS" - http://jsfiddle.net/qGCUk/3/ The CSS reset used in that defaults all list margins and paddings to 0

UPDATE http://jsfiddle.net/qGCUk/4/ - you have to include your sub-lists in your main <li>

ol {
  counter-reset: item
}
li {
  display: block
}
li:before {
  content: counters(item, ".") " ";
  counter-increment: item
}
<ol>
  <li>one</li>
  <li>two
    <ol>
      <li>two.one</li>
      <li>two.two</li>
      <li>two.three</li>
    </ol>
  </li>
  <li>three
    <ol>
      <li>three.one</li>
      <li>three.two
        <ol>
          <li>three.two.one</li>
          <li>three.two.two</li>
        </ol>
      </li>
    </ol>
  </li>
  <li>four</li>
</ol>
Answer from Zoltan Toth on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_lists_ordered.asp
HTML Ordered Lists
Use the HTML <ol> element to define an ordered list ยท Use the HTML type attribute to define the numbering type ยท Use the HTML <li> element to define a list item ยท Lists can be nested ยท List items can contain other HTML elements ยท For a ...
People also ask

How do I create a nested list in HTML?
To create a nested list, place a
    or
      element inside an
    1. element of another list. Ensure to properly close all tags and structure your list to enhance readability and accessibility.
๐ŸŒ
dhiwise.com
dhiwise.com โ€บ post โ€บ how-to-create-nested-lists-in-html-a-simple-guide
HTML Nested Lists: A Simple Guide
How can I customize the appearance of nested lists with CSS?
You can customize nested lists using CSS properties such as list-style-type for changing bullet points, list-style-image for custom bullets, and pseudo-elements for adding icons or animations to list items.
๐ŸŒ
dhiwise.com
dhiwise.com โ€บ post โ€บ how-to-create-nested-lists-in-html-a-simple-guide
HTML Nested Lists: A Simple Guide
Can I nest ordered lists inside unordered lists?
Yes, you can nest ordered lists (
    ) inside unordered lists (
      ) and vice versa. This allows for a flexible structure to suit the content and hierarchy of your information.
๐ŸŒ
dhiwise.com
dhiwise.com โ€บ post โ€บ how-to-create-nested-lists-in-html-a-simple-guide
HTML Nested Lists: A Simple Guide
๐ŸŒ
Mark
mark.ie โ€บ blog โ€บ nested-lists-in-css-with-a-numbered-hierarchy
Nested lists in CSS with a numbered hierarchy | Mark Conroy | Lead Frontend Drupal Developer
Using CSS, we can make nested ordered lists automatically display in a numbered hierarchyโ€”like "1, 1.1, 1.2, 2, 2.1", without any additional HTML markup changes. Hereโ€™s how to set it up!
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ nested-list-in-html
Nested List in HTML - GeeksforGeeks
July 23, 2025 - A nested list in HTML is a list that contains other lists within its list items. This creates a hierarchical structure, where each sublist is indented to visually represent its relationship to the parent list item.
๐ŸŒ
Scaler
scaler.com โ€บ topics โ€บ nested-list-in-html
How to Create a Nested List in HTML? - Scaler Topics
October 18, 2022 - Always the first child of the <ul> tag will be a <li> tag after that, you can nest another <ul> or <ol> tag to create a nested ordered/unordered list. Note: Element <ul> is not allowed as child of element <ul>. We need to add a <li> enclosing to the children <ul> tags.
๐ŸŒ
DhiWise
dhiwise.com โ€บ post โ€บ guide-to-creating-structure-content-using-html-ordered-lists
Creating Structured Content with HTML Ordered List
June 4, 2024 - For example, if you want to use ... numbering style within the same list. You can do this by nesting an <ol> element with a different type attribute inside your list....
๐ŸŒ
W3Docs
w3docs.com โ€บ html
How to Display an Ordered List with Nested Counters
You can display an ordered list with nested counters like 1.1, 1.2 instead of 1, 2 by using CSS. In this snippet, youโ€™ll find some methods of displaying such numbers. <!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> ol { counter-reset: item; } li { display: block; color: #666666; } li:before { content: counters(item, ".") " "; counter-increment: item; } </style> </head> <body> <ol> <li>Element 1 <ol> <li>Sub element 1</li> <li>Sub element 2</li> <li>Sub element 3</li> </ol> </li> <li>Element 2</li> <li>Element 3 <ol> <li>Sub element 1</li> <li>Sub element 2</li> <li>Sub element 3</li> </ol> </li> </ol> </body> </html>
Find elsewhere
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ HTML โ€บ Reference โ€บ Elements โ€บ ol
<ol>: The Ordered List element - HTML | MDN
Typically, ordered list items display with a preceding marker, such as a number or letter. The <ol> and <ul> (or the synonym <menu>) elements may nest as deeply as desired, alternating between <ol>, <ul> (or <menu>) as needed.
๐ŸŒ
DhiWise
dhiwise.com โ€บ post โ€บ how-to-create-nested-lists-in-html-a-simple-guide
HTML Nested Lists: A Simple Guide
September 30, 2024 - To output nested ordered lists, you can use HTML attributes like type, start, and reversed to control the formatting and structure, such as compactness, reversed ordering, and starting points.
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ how-to-create-a-nested-list-in-html
How to create a nested list in HTML
The nested ul represents an unordered list, and the inner li tag displays vegetables of each category. To create an ordered list in HTML, use the ol (ordered list) tag with the li (list item) tag in a hierarchical structure.
๐ŸŒ
Knowledgeowl
support.knowledgeowl.com โ€บ help โ€บ customize-nested-numbered-list-styles
Customize nested numbered list styles | KnowledgeOwl Support
To achieve the list style above, use a counter within the numbered list, so that it numbers the 1.x and 1.1.x strings, etc., based on the count and position of the list items: Go to Customize > Style (HTML & CSS). In the Customize HTML, CSS, and JS section, select Custom CSS. Copy the CSS below and paste it into the CSS pane: /* Styles for formatting sub-ordered-list-items with 1.1., 1.1.1., etc.)*/ /* First, set all numbered lists to use counter-reset */ .hg-article-body ol { counter-reset: item; } /* Display all list items in a numbered list in block display */ .hg-article-body ol>li { display: block; } /* Use a counter that checks the number of items and adds a "." between them and ends with ".
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-display-an-ordered-list-with-nested-counters
How to Display an Ordered List with Nested Counters?
In this snippet, we will discuss two methods for creating an ordered list with nested counters using the display property. An element with the display property set to block begins on a new line and occupies the entire screen width. For such elements, we can specify their width and height. Elements that are at the block level by default include <div>, <section>, <p>, and many others. We can make the span from the previous HTML code behave like a block-level element by setting it to block display.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ what-is-nesting-of-list-how-to-create-the-nested-list-in-html
What is nesting of list & how to create the nested list in HTML ? - GeeksforGeeks
Nesting of lists in HTML involves placing one list within another list item, creating a hierarchical structure. This is done by embedding a <ul> (unordered) or <ol> (ordered) list inside an <li> (list item) element.
Published ย  July 23, 2025
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_lists.asp
HTML Lists
Each list item starts with the <li> tag. The list items will be marked with bullets (small black circles) by default: <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> ... An ordered list starts with the <ol> tag.
๐ŸŒ
Shiksha
shiksha.com โ€บ home โ€บ it & software โ€บ it & software articles โ€บ programming articles โ€บ html lists: ordered and unordered lists explained with examples
HTML Lists: Ordered and Unordered Lists Explained with Examples - Shiksha Online
October 13, 2024 - An HTML Nested list refers to a list within another list. We can create a nested ordered list, a nested unordered list, or a nested ordered list inside an unordered list.
๐ŸŒ
Shay Howe
learn.shayhowe.com โ€บ html-css โ€บ creating-lists
Creating Lists - Learn to Code HTML & CSS
One trick with nesting lists is to know where to begin and end each list and list item. Speaking specifically about unordered and ordered lists, as that is where most nesting will occur, the only element that may reside directly within the <ul> and <ol> elements is the <li> element.
๐ŸŒ
SitePoint
sitepoint.com โ€บ html & css
Nested ordered lists with counters, driving me nuts! - HTML & CSS - SitePoint Forums | Web Development & Design Community
March 8, 2011 - Hi guys, First time poster here, so please be gentle. I am hoping one of you CSS gurus can help me out. I have been struggling with creating a nested ordered list, numbered correctly with decimals, using CSS 2.1 counters. To appear like so: [B]1. First Sentence 2. Second Sentence 2.1 Sub Sentence ...
๐ŸŒ
Sololearn
sololearn.com โ€บ en โ€บ Discuss โ€บ 3229759 โ€บ can-an-ordered-list-be-nested-within-a-list-item
Can an ordered list be nested within a list item? | Sololearn: Learn to code for FREE!
Jack Bogard ,Sakshi Yes, an ordered list can be nested within a list item in HTML. Its meaning that elements can be placed inside other elements. For example see this post..