Skip to content

Instantly share code, notes, and snippets.

@ctrl-freak
Created June 20, 2011 03:10
Show Gist options
  • Save ctrl-freak/1035062 to your computer and use it in GitHub Desktop.
Save ctrl-freak/1035062 to your computer and use it in GitHub Desktop.
Sequential Outline Numbering of Ordered Lists
ol {list-style: none;}
body > ol { counter-reset:level1;}
body > ol > li { counter-increment:level1; }
body > ol > li:before {content: counter(level1) " "; }
body > ol > li > ol { counter-reset:level2; }
body > ol > li > ol > li { counter-increment:level2; }
body > ol > li > ol > li:before { content: counter(level1) "." counter(level2) " "; }
body > ol > li > ol > li > ol { counter-reset:level3; }
body > ol > li > ol > li > ol > li { counter-increment:level3; }
body > ol > li > ol > li > ol > li:before { content: counter(level1) "." counter(level2) "." counter(level3) " ";}
body > ol > li > ol > li > ol > li > ol { counter-reset:level4; }
body > ol > li > ol > li > ol > li > ol > li { counter-increment:level4;}
body > ol > li > ol > li > ol > li > ol > li:before { content: counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) " ";}
body > ol > li > ol > li > ol > li > ol > li > ol { counter-reset:level5; }
body > ol > li > ol > li > ol > li > ol > li > ol > li { counter-increment:level5;}
body > ol > li > ol > li > ol > li > ol > li > ol > li:before { content: counter(level1) "." counter(level2) "." counter(level3) "." counter(level4) "." counter(level5) " ";}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment