Created
October 31, 2019 15:41
-
-
Save jirikuncar/dbbc11f6a2a17a107fa7fc3f9bbdf754 to your computer and use it in GitHub Desktop.
Number headers with CSS
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
body { | |
counter-reset: h2counter; | |
} | |
h1 { | |
counter-reset: h2counter; | |
} | |
main h2:before { | |
content: counter(h2counter) ".\0000a0\0000a0"; | |
} | |
main h2 { | |
counter-increment: h2counter; | |
counter-reset: h3counter; | |
} | |
main h3:before { | |
content: counter(h2counter) "." counter(h3counter) ".\0000a0\0000a0"; | |
} | |
main h3 { | |
counter-increment: h3counter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment