嵌套计数器
以下实例在页面创建一个计数器,在每一个 <h1> 元素前添加计数值 "Section <主标题计数值>.", 嵌套的计数值则放在 <h2> 元素的前面,内容为 "<主标题计数值>.<副标题计数值>":
CSS 实例
body {
counter-reset: section;}
h1 {
counter-reset: subsection;}
h1::before {
counter-increment: section;
content: "Section " counter(section) ". ";}
h2::before {
counter-increment: subsection;
content: counter(section) "." counter(subsection) " ";
}
https://www.scsmld.com/bkzn33/ 标签:section,counter,嵌套,计数器,subsection,Section From: https://www.cnblogs.com/5-si6/p/17405402.html