CSS counter-reset 属性


对部分和子部分进行编号(比如 "Section 1"、"1.1"、"1.2")的方法:

body
 {  counter-reset:section;
 }

h1
 {  counter-reset:subsection;
 }

h1:before
 {
 content:"Section " counter(section) ". ";
 counter-increment:section;
 }

h2:before
 {
 counter-increment:subsection;
 content:counter(section) "." counter(subsection) " ";
 }


上一篇 下一篇