Skip to content

How Do I Add Auto Enumerating Headings ? #914

Discussion options

You must be logged in to vote

I had the same issue, are CSS counters enough for you?

h1 {
  counter-increment: h1;
  counter-reset: h2;
}
h2 {
  counter-increment: h2;
  counter-reset: h3;
}
h3 {
  counter-increment: h3;
}
h1::before {
  content: counter(h1)'. ';
}
h2::before {
  content: counter(h1)'.'counter(h2)'. ';
}
h3::before {
  content: counter(h1)'.'counter(h2)'.'counter(h3)'. ';
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sereneinserenade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants