function

counter() — CSS reference

Formats the innermost named counter as a string using the optional counter style (decimal by default). The name must agree with the counter declaration. It does not change the counter value.

Formal Syntax & Structure

css syntaxcss
counter(name, style?)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a {counter-reset:step} li {counter-increment:step} li::before {content:counter(step, upper-roman) " "}</style><body><ul id="a"><li>Plan</li><li>Build</li></ul></body></html>
CSS Reference