MediaWiki:Common.css: Difference between revisions
(Created page with "→CSS placed here will be applied to all skins: body { counter-reset: h2counter; } h2 { counter-reset: h3counter; } h3 { counter-reset: h4counter; } h2::before { counter-increment: h2counter; content: counter(h2counter) ". "; } h3::before { counter-increment: h3counter; content: counter(h2counter) "." counter(h3counter) " "; } h4::before { counter-increment: h4counter; content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) " "; }...") |
No edit summary |
||
| Line 1: | Line 1: | ||
/* CSS placed here will be applied to all skins */ | /* CSS placed here will be applied to all skins */ | ||
/* Reset all heading counters at the start of the page */ | |||
body { | body { | ||
counter-reset: h2counter; | counter-reset: h2counter; | ||
} | } | ||
h2 { counter-reset: h3counter; } | h2 { | ||
h3 { counter-reset: h4counter; } | counter-reset: h3counter; | ||
} | |||
h3 { | |||
counter-reset: h4counter; | |||
} | |||
h4 { | |||
counter-reset: h5counter; | |||
} | |||
h5 { | |||
counter-reset: h6counter; | |||
} | |||
/* Add numbering before headings */ | |||
h2::before { | h2::before { | ||
counter-increment: h2counter; | counter-increment: h2counter; | ||
| Line 22: | Line 37: | ||
} | } | ||
h2::before, h3::before, h4::before { | h5::before { | ||
counter-increment: h5counter; | |||
content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) "." counter(h5counter) " "; | |||
} | |||
h6::before { | |||
counter-increment: h6counter; | |||
content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) "." counter(h5counter) "." counter(h6counter) " "; | |||
} | |||
/* Optional: style numbers */ | |||
h2::before, h3::before, h4::before, h5::before, h6::before { | |||
color: #555; | color: #555; | ||
margin-right: 0.3em; | margin-right: 0.3em; | ||
} | } | ||
Revision as of 07:19, 19 October 2025
/* CSS placed here will be applied to all skins */
/* Reset all heading counters at the start of the page */
body {
counter-reset: h2counter;
}
h2 {
counter-reset: h3counter;
}
h3 {
counter-reset: h4counter;
}
h4 {
counter-reset: h5counter;
}
h5 {
counter-reset: h6counter;
}
/* Add numbering before headings */
h2::before {
counter-increment: h2counter;
content: counter(h2counter) ". ";
}
h3::before {
counter-increment: h3counter;
content: counter(h2counter) "." counter(h3counter) " ";
}
h4::before {
counter-increment: h4counter;
content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) " ";
}
h5::before {
counter-increment: h5counter;
content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) "." counter(h5counter) " ";
}
h6::before {
counter-increment: h6counter;
content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) "." counter(h5counter) "." counter(h6counter) " ";
}
/* Optional: style numbers */
h2::before, h3::before, h4::before, h5::before, h6::before {
color: #555;
margin-right: 0.3em;
}