Skip to content

Instantly share code, notes, and snippets.

@justinhough
Created October 11, 2015 06:13
Show Gist options
  • Save justinhough/afd3cb39184dc0c1a41e to your computer and use it in GitHub Desktop.
Save justinhough/afd3cb39184dc0c1a41e to your computer and use it in GitHub Desktop.
Counter Increment
//A way to number sections and sub-sections with "Section 1", "1.1", "1.2", etc.:
body {
counter-reset:section;
}
h1 {
counter-reset:subsection;
}
h1:before {
counter-increment:section;
content:"Section " counter(section) ". ";
}
h2:before {
counter-increment:subsection;
content:counter(section) "." counter(subsection) " ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment