MDN self-hosted library · e01.org

`::marker` CSS pseudo-element

The ::marker CSS pseudo-element selects the marker box of a list item, which typically contains a bullet or number. It works on any element or pseudo-element set to display: list-item, such as the li and summary elements.

no runnable cells css-pseudo-element upstream source

The ::marker CSS pseudo-element selects the marker box of a list item, which typically contains a bullet or number. It works on any element or pseudo-element set to display: list-item, such as the li and summary elements.

tabbed-shorter

```css interactive-example li::marker { content: "✝ "; font-size: 1.2em; }


```html interactive-example
<p>Group known as Mercury Seven:</p>
<ul>
  <li>Malcolm Scott Carpenter</li>
  <li>Leroy Gordon (Gordo) Cooper Jr.</li>
  <li>John Herschel Glenn Jr.</li>
  <li>Virgil Ivan (Gus) Grissom</li>
  <li>Walter Marty (Wally) Schirra Jr.</li>
  <li>Alan Bartlett Shepard Jr.</li>
  <li>Donald Kent (Deke) Slayton</li>
</ul>

Allowable properties

The ::marker pseudo-element supports a limited number of CSS properties, including:

  • All animation and transition properties
  • All font properties
  • color
  • content
  • counter-increment, counter-reset, and counter-set
  • quotes
  • text-combine-upright, unicode-bidi, and direction
  • white-space

[!NOTE] The specification states that additional CSS properties may be supported in the future.

Syntax

::marker {
  /* ... */
}

Examples

HTML

<ul>
  <li>Peaches</li>
  <li>Apples</li>
  <li>Plums</li>
</ul>

CSS

ul li::marker {
  color: red;
  font-size: 1.5em;
}

Result

Examples

Specifications

Browser compatibility

See also