pseudo-element

::marker Pseudo-Element

Styles the marker box of a list item, such as a bullet or ordered-list number. Only a limited property set including color, font, and content applies.

::marker

Example

li::marker { color: crimson; } /* Red bullets */

✓ Matches

  • <ul><li>A</li></ul> targets the bullet
  • <ol><li>A</li></ol> targets the number
  • <summary>Details</summary> targets the disclosure marker

✗ Does not match

  • <div>Not a list item</div>
  • <p>Paragraph</p>

Browser support

Supported in all modern browsers since 2020.

Related selectors

← All CSS selectors · CSS selectors cheat sheet