Google News
logo
CSS - Interview Questions
What is CSS counter-increment Property?
The counter-increment property increases or decreases the value of one or more CSS counters. The counter-increment property is usually used together with the counter-reset property and the content property.
 
Example :
 
body {
  /* Set “my-sec-counter” to 0 */
   counter-reset: my-sec-counter;
}

h2:before {
   /* Increment “my-sec-counter” by 1 */
   counter-increment: my-sec-counter;
   content: “Section ” counter(my-sec-counter) “. “;
 }
Advertisement