Working Draft · css-lists

CSS Lists

8 properties, 2 functions, 1 type defined by this specification, 10 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

counter-increment

Property Baseline: widely availablesince January 2018

MDN The counter-increment CSS property can be used to increase or decrease the value of the named CSS counters by the specified values, or to prevent all counters or an individual counter's value from being changed.

Live preview Example from MDN
#default-example {
  text-align: left;
  counter-reset: chapter-count;
}

#example-element {
  background-color: lightblue;
  color: black;
}

h2 {
  counter-increment: chapter-count;
  font-size: 1em;
}

h2::before {
  content: "Chapter " counter(chapter-count) ": ";
}

Syntax

[ <counter-name> <integer>? ]+ | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
the keyword none or a list, each item an identifier paired with an integer
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting counter-increment
Chrome 2
Edge 12
Firefox 1
Safari 3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

counter-reset

Property Baseline: widely availablesince January 2018

MDN The counter-reset CSS property creates named CSS counters and initializes their values. It can create both regular and reversed counters.

Live preview Example from MDN
#default-example {
  text-align: left;
  counter-reset: chapter-count;
}

#example-element {
  background-color: lightblue;
  color: black;
}

h2 {
  counter-increment: chapter-count;
  font-size: 1em;
}

h2::before {
  content: "Chapter " counters(chapter-count, ".") ": ";
}

Syntax

[ <counter-name> <integer>? | <reversed-counter-name> <integer>? ]+ | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
the keyword none or a list, each item an identifier or a reversed() function paired with an integer
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting counter-reset
Chrome 2
Edge 12
Firefox 1
Safari 3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

counter-set

Property Baseline: widely availablesince June 2026 Modern CSS: counter-set

MDN The counter-set CSS property sets CSS counters on the element to the given values.

Live preview Example from MDN
#default-example {
  text-align: left;
  counter-set: chapter-count;
}

#example-element {
  background-color: #37077c;
  color: white;
}

h2 {
  counter-increment: chapter-count;
  font-size: 1em;
}

h2::before {
  content: "Chapter " counter(chapter-count) ": ";
}

Syntax

[ <counter-name> <integer>? ]+ | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
the keyword none or a list, each item an identifier paired with an integer
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting counter-set
Chrome 85
Edge 85
Firefox 68
Safari 17.2
Chrome Android 85
Safari iOS 17.2

First version with support, from MDN browser-compat-data.

list-style

Property Baseline: widely availablesince January 2018 Modern CSS: symbols()

MDN The list-style CSS shorthand property allows you to set all the list style properties at once.

Live preview Example from MDN
.default-example {
  font-size: 1.2rem;
}

#example-element {
  width: 100%;
  background: #be094b;
  color: white;
}

section {
  text-align: left;
  flex-direction: column;
}

hr {
  width: 50%;
  color: lightgray;
  margin: 0.5em;
}

.note {
  font-size: 0.8rem;
}

.note a {
  color: #009e5f;
}

@counter-style space-counter {
  symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
  suffix: " ";
}

Syntax

<'list-style-position'> || <'list-style-image'> || <'list-style-type'>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
see individual properties
Applies to
list items
Inherited
see individual properties
Percentages
see individual properties
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
list-style-type, list-style-position, list-style-image

Browser support

First browser version supporting list-style
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

list-style-image

Property Baseline: widely availablesince January 2018

MDN The list-style-image CSS property sets an image to be used as the list item marker.

Live preview Example from MDN
.default-example {
  font-size: 1.2rem;
}

#example-element {
  width: 100%;
  background: #be094b;
  color: white;
}

section {
  text-align: left;
  flex-direction: column;
}

hr {
  width: 50%;
  color: lightgray;
  margin: 0.5em;
}

.note {
  font-size: 0.8rem;
}

.note a {
  color: #009e5f;
}

@counter-style space-counter {
  symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
  suffix: " ";
}

Syntax

<image> | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
list items
Inherited
yes
Percentages
n/a
Computed value
the keyword noneor the computed <image>
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting list-style-image
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

list-style-position

Property Baseline: widely availablesince January 2018

MDN The list-style-position CSS property sets the position of the ::marker relative to a list item.

Live preview Example from MDN
.default-example {
  font-size: 1.2rem;
}

#example-element {
  width: 100%;
  background: #be094b;
  color: white;
}

section {
  text-align: left;
  flex-direction: column;
}

hr {
  width: 50%;
  color: lightgray;
  margin: 0.5em;
}

.note {
  font-size: 0.8rem;
}

.note a {
  color: #009e5f;
}

@counter-style space-counter {
  symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
  suffix: " ";
}

Syntax

inside | outside

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
outside
Applies to
list items
Inherited
yes
Percentages
n/a
Computed value
keyword, but see prose
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting list-style-position
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

list-style-type

Property Baseline: widely availablesince January 2018

MDN The list-style-type CSS property sets the marker (such as a disc, character, or custom counter style) of a list item element.

Live preview Example from MDN
.default-example {
  font-size: 1.2rem;
}

#example-element {
  width: 100%;
  background: #be094b;
  color: white;
}

section {
  text-align: left;
  flex-direction: column;
}

hr {
  width: 50%;
  color: lightgray;
  margin: 0.5em;
}

.note {
  font-size: 0.8rem;
}

.note a {
  color: #009e5f;
}

@counter-style space-counter {
  symbols: "\1F680" "\1F6F8" "\1F6F0" "\1F52D";
  suffix: " ";
}

Syntax

<counter-style> | <string> | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
disc
Applies to
list items
Inherited
yes
Percentages
n/a
Computed value
specified value
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting list-style-type
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

marker-side

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

match-self | match-parent

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
match-self
Applies to
list items
Inherited
yes
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

counter()

Function Baseline: widely availablesince January 2018

Spec Counters have no visible effect by themselves, but their values can be used with the counter() and counters() functions, whose used values represent counter values as strings or images. They are defined as follows:

MDN The counter() CSS function returns a string representing the current value of the named counter, if there is one.

Live preview Example from MDN
.double-list {
  counter-reset: count -1;
}

.double-list li {
  counter-increment: count 2;
}

.double-list li::marker {
  content: counter(count, decimal) ") ";
}

Syntax

counter( <counter-name>, <counter-style>? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting counter()
Chrome 1
Edge 12
Firefox 1
Safari 3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

counters()

Function Baseline: widely availablesince January 2018

Spec Counters have no visible effect by themselves, but their values can be used with the counter() and counters() functions, whose used values represent counter values as strings or images. They are defined as follows:

MDN The counters() CSS function enables combining markers when nesting counters. The function returns a string that concatenates the current values of the named and nested counters, if any are present, with the string provided. The third, optional parameter enables defining the list style.

Live preview Example from MDN
ol {
  counter-reset: index;
  list-style-type: none;
}

li::before {
  counter-increment: index;
  content: counters(index, ".", decimal) " ";
}

Syntax

counters( <counter-name>, <string>, <counter-style>? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting counters()
Chrome 1
Edge 12
Firefox 1.5
Safari 3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

<counter>

Type Baseline: widely availablesince January 2018

MDN The counter() CSS function returns a string representing the current value of the named counter, if there is one.

Live preview Example from MDN
.double-list {
  counter-reset: count -1;
}

.double-list li {
  counter-increment: count 2;
}

.double-list li::marker {
  content: counter(count, decimal) ") ";
}

Syntax

<counter()> | <counters()>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting <counter>
Chrome 1
Edge 12
Firefox 1
Safari 3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.