counter-set
Sets a CSS counter to a specified value. Unlike 'counter-reset', which starts a new scope, 'counter-set' modifies the value of an existing counter within the current scope.
It is documented as part of the CSS Lists and Counters specification.
Syntax
/* Usage Example */
.special-item {
/* Hard-sets the 'item-num' counter to 99 */
counter-set: item-num 99;
}
/* Syntax */
counter-set: none;
/* Global values */
counter-set: inherit;
counter-set: initial;
counter-set: revert;
counter-set: revert-layer;
counter-set: unset;
counter-set Browser support
Newly available
Since
2023 93% global usage
Since 2023 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
85+
68+
17.2+
85+