Skip to content

Instantly share code, notes, and snippets.

@Anks
Created August 30, 2009 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anks/177950 to your computer and use it in GitHub Desktop.
Save Anks/177950 to your computer and use it in GitHub Desktop.
CSS for adding header numbering to google documents
/**
* CSS to add section numbers to top-level headings in
* a Google Docs (or any HTML) document.
*
* See <http://www.w3.org/TR/CSS2/generate.html> for
* more details.
*/
body {
counter-reset: section;
}
h1:before {
counter-reset: subsection;
counter-increment: section;
content: counter(section) ". ";
}
h2:before {
counter-reset: subsubsection;
counter-increment: subsection;
content: counter(section) "." counter(subsection) ". ";
}
h3:before {
counter-increment: subsubsection;
content: counter(section) "." counter(subsection) "." counter(subsubsection) ". ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment