Skip to content

Instantly share code, notes, and snippets.

@adamcrosby
Created March 17, 2011 04:43
Show Gist options
  • Save adamcrosby/873853 to your computer and use it in GitHub Desktop.
Save adamcrosby/873853 to your computer and use it in GitHub Desktop.
body {
counter-reset: h1section;
}
section h1:before{
content: counter(h1section) ". ";
counter-increment: h1section;
}
section h1 {
counter-reset: h2section;
}
section h2:before{
content: counter(h1section) "." counter(h2section) ". ";
counter-increment: h2section;
}
section h2 {
counter-reset: h3section;
}
section h3:before{
content: counter(h1section) "." counter(h2section) "." counter(h3section) ". ";
counter-increment: h3section;
}
section h3 {
counter-reset: h4section;
}
section h4:before{
content: counter(h1section) "." counter(h2section) "." counter(h3section) "." counter(h4section) ". ";
counter-increment: h4section;
}
section h4 {
counter-reset: h5section;
}
section h5:before{
content: counter(h1section) "." counter(h2section) "." counter(h3section) "." counter(h4section) "." counter(h5section) ". ";
counter-increment: h5section;
}
section h5 {
counter-reset: h6section;
}
section h6:before{
content: counter(h1section) "." counter(h2section) "." counter(h3section) "." counter(h4section) "." counter(h5section) "." counter(h6section) ". ";
counter-increment: h6section;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment