Typography

List Style Position

Utilities for controlling the position of bullets/numbers in lists.

Quick reference

Class
Properties
list-insidelist-style-position: inside;
list-outsidelist-style-position: outside;

Basic usage

Setting the list style position

Control the position of the markers and text indentation in a list using the list-inside and list-outside utilities.

List Style Position - 图1

  1. <ul class="list-inside ...">
  2. <li>5 cups chopped Porcini mushrooms</li>
  3. <!-- ... -->
  4. </ul>
  5. <ul class="list-outside ...">
  6. <li>5 cups chopped Porcini mushrooms</li>
  7. <!-- ... -->
  8. </ul>

Applying conditionally

Hover, focus, and other states

Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:list-inside to only apply the list-inside utility on hover.

  1. <ul class="list-outside hover:list-inside">
  2. <!-- ... -->
  3. </ul>

For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.

Breakpoints and media queries

You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:list-inside to apply the list-inside utility at only medium screen sizes and above.

  1. <ul class="list-outside md:list-inside">
  2. <!-- ... -->
  3. </ul>

To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers.