Lists

Set list-style-type on an entire <ol>/<ul>, or override a single <li class="item-*"> - covers numeric, alphabetic, and non-Latin counter styles.

Whole-list style

Add a style class directly to the <ol> or <ul> to change every item's marker at once.

Preview

  1. First
  2. Second
  3. Third
  1. First
  2. Second
  3. Third
  • Alpha
  • Beta
  • Gamma
<ol class="decimal-leading-zero">
  <li>First</li>
  <li>Second</li>
</ol>

<ul class="square">
  <li>Alpha</li>
  <li>Beta</li>
</ul>

Per-item style

Use .item-{style} on a single <li> to override just that item's marker, leaving the rest of the list untouched.

  • Regular disc item
  • Square item
  • Circle item
<ul>
  <li>Regular item</li>
  <li class="item-square">Highlighted item</li>
</ul>

Any <a> inside a list item inherits currentColor instead of the browser's default link-blue - handy for nav lists and menus styled with a parent text color.

<ul class="text-white">
  <li><a href="#">Inherits white, not link-blue</a></li>
</ul>

Reference

Classlist-style-type
.decimaldecimal
.decimal-leading-zerodecimal-leading-zero
.lower-alpha / .upper-alphalower-alpha / upper-alpha
.lower-latin / .upper-latinlower-latin / upper-latin
.lower-roman / .upper-romanlower-roman / upper-roman
.lower-greeklower-greek
.disc / .circle / .squaredisc / circle / square
.armenian, .georgian, .hebrewMatching native counter styles
.cjk-ideographic, .hiragana, .hiragana-iroha, .katakana, .katakana-irohaMatching native counter styles
.item-{style}Applies any style above to a single <li>