h3:before {
content: counter(chapter)".";
margin-right: 5px;
color: #99cc99;
}
h3 {
counter-increment: chapter;
}
h3:first-letter {
font-family: Arial;
font-size: 2em;
}
ほげほげ
ふがふが
ほにゃららら
h2 {
counter-reset: chapter;
}
h4:before {
content: counter(chapter)"-" counter(section)"-" counter(subsection)".";
margin-right: 20px;
}
h4 {
counter-reset: chapter;
counter-increment: chapter section subsection 2;
}
h4 {
padding-left: 5px;
border-left: solid 3px #99cc99;
color: #66aa66;
}
増える数字
増える数字
ふえるわかめ
content: counter(chapter)"-" counter(section)"-" counter(subsection)".";
の chapter - section - subsection
が、見出しの 1 - 1 - 3 と対応している。