Decimal Ordered Lists
Decimal ordered lists or decimal outlines can be useful when it is desired to have nested lists where every <li> identifies its relationship to all of its predecessors. This style would be useful in official documents for government and other similar organizations.
BONUS! Check out Item One for an example of anchoring to a specific <li>.
Accessibility Notice
I have verified that both the VoiceOver and Spoken Content features in iOS 13's Accessibility options identifiy each number as expected for all users. Since the numbering is put in place using the pseudo-element of ::before, be advised that the numbers shown on screen might not be accessible for all screen readers.
Sample
- Part One
- Section One
- Clause One
- Clause Two
- Item One
- Subitem
- Item Two
- Section One
- Section Two
Code
The code below is the magic that makes the above sample happen.
- Part One
- Section One
- Clause One
- Clause Two
- Item One
- Subitem
- Item Two
- Section One
- Section Two
Adapted from: stackoverflow.com
Obstacles Encountered
I would prefer to give the original <ol> the class of "decimal" rather than wrapping it in a DIV with that class as it would make the code a little simpler. However I ran into the problem of the first nested <ol> not reflecting its relationship as a child of the outmost <ol>. Every following <ol> was fine from that point on. See the example below.
- First list
- Second list
- Third list
- Fourth list
- Third list
- Second list
