Venu Madhav Venu Madhav - 5 months ago 14
CSS Question

Issue with counter-increment in css

I am facing a problem with css counter-increment, number is not appearing in Output.Please help me.
Please explain me clearly.

This is my codepen: codepen

enter code here

Answer

"counter(number)" will be detected as string. Just remove the "".

h1:before {
  counter-increment: number;
  content: counter(number);
}

If you want with period after number:

h1:before {
  counter-increment: number;
  content: counter(number) ". ";
}
Comments