CSS counters() Function

❮ Previous Functions Next ❯

Example

li::before {
  content:  counters(count, '.', upper-roman) ') ';
}

Meaning

The counters() css function sets nested counters, returning a concatenated string representing the current values of the named counters, if there are any.

Version: CSS2




Standard Syntax

counters(name, string, style)



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







Function Arguments

The following table describes the arguments of this function.

Argument Description
name Specifies the unique name for counter-reset and counter-increment.
string Specifies a number of text characters. Non-Latin characters must be encoded using their Unicode escape sequences.
style The counter-style defaults to decimal. Specifies a counter style name is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east Asian or Ethiopic predefined counter style, or other predefined counter style.

If omitted, the counter-style defaults to decimal.




See also

❮ Previous Functions Next ❯