property

counter-set — CSS reference

Sets the value of the innermost applicable counter of the given name; if none exists, it creates one. Unlike a reset, it can update an existing counter instead of introducing another nested instance.

Formal Syntax & Structure

css syntaxcss
counter-set: section 10;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a {counter-reset:section} #a p {counter-increment:section} #a p:first-child {counter-set:section 10} #a p::before {content:counter(section) ". "}</style><body><section id="a"><p>Restart</p><p>Next</p></section></body></html>
CSS Reference