Skip to content

Instantly share code, notes, and snippets.

@teddyzetterlund
Created June 26, 2013 05:33
Show Gist options
  • Save teddyzetterlund/5865005 to your computer and use it in GitHub Desktop.
Save teddyzetterlund/5865005 to your computer and use it in GitHub Desktop.
Automatic figure numbering with CSS counters
article {
counter-reset: figures;
}
figure {
counter-increment: figures;
}
figcaption:before {
content: "Fig. " counter(figures) " - "; /* For I18n support; use data-counter-string. */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment