Created
July 15, 2024 11:51
-
-
Save itst/dd23201d2b0c4ccbc6570b6a40141d97 to your computer and use it in GitHub Desktop.
Header numbering for Confluence Pages. Use the HTML macro to implement. You can put this CSS into your theme, individual pages or use it in templates.
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
/* | |
* This is an opionionated chunk of CSS. | |
* It add's numbering to headers h2 and h3. | |
* | |
* Why not for h1? h1 is the page title. | |
* Why not for h4? Because that's to deep. | |
* | |
* Adapt as needed :-) | |
*/ | |
.contentLayout2 { | |
counter-reset: h2 h3; | |
} | |
.innerCell > h2 { | |
counter-reset: h3; | |
} | |
.innerCell > h2::before { | |
content: counters(h2, ".") " "; | |
counter-increment: h2; | |
} | |
h3::before { | |
content: counter(h2) "." counter(h3) " "; | |
counter-increment: h3; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment