Created
January 24, 2019 11:05
-
-
Save bultas/6d3b0c8891734956d0811aefb9dadf9b to your computer and use it in GitHub Desktop.
CSS numbered Headlines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Fixed h3 numbering http://2ality.com/2012/01/numbering-headingshtml.html */ | |
body { | |
counter-reset: h2counter; | |
} | |
h1 { | |
counter-reset: h2counter; | |
} | |
h2 { | |
counter-reset: h3counter; | |
} | |
h2:before { | |
content: counter(h2counter) ".\0000a0\0000a0"; | |
counter-increment: h2counter; | |
} | |
h2.nocount:before { | |
content: none; | |
counter-increment: none; | |
} | |
h3:before { | |
content: counter(h2counter) "." counter(h3counter) | |
".\0000a0\0000a0"; | |
counter-increment: h3counter; | |
} | |
h3.nocount:before { | |
content: none; | |
counter-increment: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment