Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

::marker — list marker pseudo-element

The ::marker pseudo-element styles a list item's bullet or number independently of its text. It supports a limited set of properties, including color and font properties.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

selector::marker { color: #005a9c; font-weight: bold; }

::marker represents a list item's marker box, such as a bullet or number. The selector .steps > li::marker targets the markers of li elements that are direct children of .steps, not those elements' text. It is a pseudo-element, not a pseudo-class; use two colons.

Markers are generated for elements with the list-item display type, not exclusively for the HTML element li. Simply appending ::marker to an ordinary element's selector does not make it a list item. Set list-style-type and list-style-position on the list item to control the marker's type and placement.

::marker does not support the full box-styling model. You can change its text color and font properties and use content to replace the marker's contents. Do not rely on margin, padding, background, or transform declared directly on ::marker.

The example preserves decimal numbering and changes only the numbers' appearance. Expect blue, bold 1. and 2. with dark Read and Practice text. Specification coverage does not guarantee implementation support; the example requires local verification in the target browser.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Marker example</title>
<style>
  .steps { list-style-type: decimal; }
  .steps > li { color: #222; }
  .steps > li::marker {
    color: #005a9c;
    font-weight: bold;
  }
</style>
<ol class="steps">
  <li>Read</li>
  <li>Practice</li>
</ol>
</html>

Result

1. Read
2. Practice

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources