字体
用于控制列表标记样式的工具类。
| Class | Styles |
|---|---|
list-disc | list-style-type: disc; |
list-decimal | list-style-type: decimal; |
list-none | list-style-type: none; |
list-(<custom-property>) | list-style-type: var(<custom-property>); |
list-[<value>] | list-style-type: <value>; |
使用 list-disc 和 list-decimal 等工具类来控制列表中标记的样式:
<ul class="list-disc"> <li>这是一个关于我的生活如何颠倒过来的故事</li> <!-- ... --></ul><ol class="list-decimal"> <li>这是一个关于我的生活如何颠倒过来的故事</li> <!-- ... --></ol><ul class="list-none"> <li>这是一个关于我的生活如何颠倒过来的故事</li> <!-- ... --></ul>Use the list-[<value>] syntax to set the 标记 based on a completely custom value:
<ol class="list-[upper-roman] ..."> <!-- ... --></ol>For CSS variables, you can also use the list-(<custom-property>) syntax:
<ol class="list-(--my-marker) ..."> <!-- ... --></ol>This is just a shorthand for list-[var(<custom-property>)] that adds the var() function for you automatically.
Prefix a list-style-type utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<ul class="list-none md:list-disc ..."> <!-- ... --></ul>Learn more about using variants in the variants documentation.