21. Specifying the type of counter created by list-style-type
Prev | Chapter 4. Other extensions | Next

## 21. Specifying the type of counter created by list-style-type

A CSS rule such as:

    ol[type="I"] {
        list-style-type: upper-roman;
    }

implicitly creates a counter, but does not allow to give it a name or to parameterize it in any way.

Extension property list-item-counter may be used to specify the counter implicitly created by list-style-type. Example:

    ol > li {
        list-item-counter: counter(list-item) ". ";
        counter-increment: list-item;
    }

- This property applies to elements having a `list-item` display.

- This property is not inherited and cannot be inherited by specifying keyword `inherit`.

- This value of property list-item-counter is similar to the value of property content, though it will almost always contain `counter()`, `counters()`, `simple-counter()` or `simple-counters()`.

- The default value of list-item-counter is: `simple-counter(n, `format`)`, where `format` is implicitly specified by the value of property list-style-type.

Prev | Up | Next
20. Simple, fast, purely declarative counters | Home | Part II. Reference