Skip to content

Instantly share code, notes, and snippets.

@zvr
Created March 9, 2021 17:30
Show Gist options
  • Save zvr/ea887f111f6faffe0fbe4babcd58c8a4 to your computer and use it in GitHub Desktop.
Save zvr/ea887f111f6faffe0fbe4babcd58c8a4 to your computer and use it in GitHub Desktop.
body { counter-reset: h1 }
h1 { counter-reset: h2 }
h2 { counter-reset: h3 }
h3 { counter-reset: h4 }
h1:before { counter-increment: h1; content: counter(h1) ". " }
h2:before { counter-increment: h2; content: counter(h1) "." counter(h2) ". " }
h3:before { counter-increment: h3; content: counter(h1) "." counter(h2) "." counter(h3) ". " }
h4:before { counter-increment: h4; content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". " }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment