Код: Выделить всё
body {
counter-reset: chapter;
}
h1 {
counter-reset: subchapter;
}
h1::before {
counter-increment: chapter;
content: "Chapter " counter(chapter) ". ";
}
h2::before {
counter-increment: subchapter;
content: counter(chapter) "." counter(subchapter) " ";
}
Код: Выделить всё
body {
counter-reset: headings1;
}
div.notranslate[placeholder="Heading 1"] {
counter-reset: headings2;
}
div.notranslate[placeholder="Heading 2"] {
counter-reset: headings3;
}
div.notranslate[placeholder="Heading 1"]::before {
counter-increment: headings1;
content: "Chapter " counter(headings1) " ";
}
div.notranslate[placeholder="Heading 2"]::before {
counter-increment: headings2;
content: "Section " counter(headings2) " ";
}
div.notranslate[placeholder="Heading 3"]::before {
counter-increment: headings3;
content: counter(headings2) "." counter(headings3) ".";
}
Код: Выделить всё
Chapter 1
Section 1
0.1
0.1
0.1
Section 1
0.1
0.1
0.1
Chapter 2
Section 1
0.1
0.1
...
Код: Выделить всё
body {
counter-set: headings1 headings2 headings3;
}
div.notranslate[placeholder="Heading 1"] {
counter-set: headings2;
}
div.notranslate[placeholder="Heading 2"] {
counter-set: headings3;
}
/*body {*/
/* counter-reset: headings1;*/
/*}*/
/*div.notranslate[placeholder="Heading 1"] {*/
/* counter-reset: headings2;*/
/*}*/
/*div.notranslate[placeholder="Heading 2"] {*/
/* counter-reset: headings3;*/
/*}*/
div.notranslate[placeholder="Heading 1"]::before {
counter-increment: headings1;
content: "Chapter " counter(headings1) " ";
}
div.notranslate[placeholder="Heading 2"]::before {
counter-increment: headings2;
content: "Section " counter(headings2) " ";
}
div.notranslate[placeholder="Heading 3"]::before {
counter-increment: headings3;
content: counter(headings2) "." counter(headings3) ".";
}
Я понимаю, что это странный вопрос и источником проблемы может быть ошибка или что-то в этом роде. Но если вы знаете что-нибудь о счетчиках в CSS, поделитесь своими знаниями

Подробнее здесь: https://stackoverflow.com/questions/720 ... set-in-css