Tailwind CSS List Style Type
The list-style-type utility class in Tailwind CSS allows you to customize the appearance of list item markers (bullets or numbers) in unordered and ordered lists.
Tailwind List Style Type
The list-style-type utility class in Tailwind CSS allows you to customize the appearance of list item markers (bullets or numbers) in unordered and ordered lists. With Tailwind's list-style-type class, you can easily change the style of list item markers to match your design requirements.
Applying List Style Type
To apply a specific list style type to a list, you can use the list-{value}
utility class, where {value}
represents the desired list style type. Here are some common list style types you can use:
- list-disc: Sets the list item markers as filled discs (default for unordered lists).
- list-circle: Sets the list item markers as hollow circles.
- list-square: Sets the list item markers as squares.
- list-decimal: Sets the list item markers as decimal numbers (default for ordered lists).
- list-decimal-leading-zero: Sets the list item markers as decimal numbers with leading zeros.
<ul class="list-disc"> <li>List item 1</li> <li>List item 2</li> <li>List item 3</li></ul>
Preview
- List item 1
- List item 2
- List item 3
Changing List Style Type
If you want to change the list style type for a specific list or override the default style, you can simply apply the desired list-{value}
class. For example, to use decimal numbers as list item markers in an unordered list, you can use the list-decimal class.
<ul class="list-decimal"> <li>List item 1</li> <li>List item 2</li> <li>List item 3</li></ul>
Preview
- List item 1
- List item 2
- List item 3
Responsive List Style Type
Tailwind CSS allows you to apply list style type classes responsively at different breakpoints. To use responsive list style type classes, you can append the breakpoint prefix to the utility class. For example, md:list-circle sets the list item markers as hollow circles starting from the medium breakpoint and above.
<ul class="list-disc md:list-circle"> <li>List item 1</li> <li>List item 2</li> <li>List item 3</li></ul>
In the above example, the list item markers are set as filled discs by default (list-disc
), but starting from the medium breakpoint and above, they change to hollow circles (md:list-circle
).
Tailwind List Style type Class Table
Class | Properties |
---|---|
list-none | list-style-type: none; |
list-disc | list-style-type: disc; |
list-decimal | list-style-type: decimal; |
Windframe Tailwind blocks
Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs