Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

::marker

The bullet or number of a list item.

Syntax

li::marker { … }

Examples

Colored numbers and custom markers:

<style>
  li::marker { color: crimson; font-weight: bold; }
  .check li::marker { content: "✔ "; color: seagreen; }
</style>
 
<ol><li>Red numbers</li><li>Bold too</li></ol>
<ul class="check"><li>Done</li><li>Also done</li></ul>

Notes

::marker allows only a few properties: color, font, content and some others — no margins or backgrounds. For a fully custom bullet, hide the marker with list-style: none and draw it with ::before.

See also

  • list-style — The look of list markers: their type, position and image.
  • content — The content of the `::before` and `::after` pseudo-elements.
  • @counter-style — Defines your own list numbering style, which can then be used in `list-style-type` and `counter()`.

Related recipes

In the tutorial

  • Styling lists and tables — Marker types and list-style, custom markers with ::marker, a menu from a list without bullets, and table borders, padding, alignment, zebra stripes and the caption.

Thanks for reading!

Donate to the site — we work hard for you.