Skip to content

Instantly share code, notes, and snippets.

@rassie
Created August 4, 2009 20:24
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 rassie/161520 to your computer and use it in GitHub Desktop.
Save rassie/161520 to your computer and use it in GitHub Desktop.
<html>
<style type="text/css">
BODY {
counter-reset: chapter; /* Create a chapter counter scope */
}
H1:before {
content: counter(chapter) ". ";
counter-increment: chapter; /* Add 1 to chapter */
}
H1 {
counter-reset: section; /* Set section to 0 */
}
H2:before {
content: counter(chapter) "." counter(section) " ";
counter-increment: section;
}
</style>
<body>
<h1>First heading</h1>
<h2>Second heading</h1>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment