排版
用于控制列表标记样式的实用工具。
类名 | 样式 |
---|---|
list-disc | list-style-type: disc; |
list-decimal | list-style-type: decimal; |
list-none | list-style-type: none; |
list-(<自定义属性>) | list-style-type: var(<自定义属性>); |
list-[<值>] | list-style-type: <值>; |
使用 list-disc
和 list-decimal
等实用工具来控制列表中标记的样式
<ul class="list-disc"> <li>Now this is a story all about how, my life got flipped-turned upside down</li> <!-- ... --></ul><ol class="list-decimal"> <li>Now this is a story all about how, my life got flipped-turned upside down</li> <!-- ... --></ol><ul class="list-none"> <li>Now this is a story all about how, my life got flipped-turned upside down</li> <!-- ... --></ul>
使用 list-[<值>]
语法 来设置标记基于完全自定义的值
<ol class="list-[upper-roman] ..."> <!-- ... --></ol>
对于 CSS 变量,您也可以使用 list-(<自定义属性>)
语法
<ol class="list-(--my-marker) ..."> <!-- ... --></ol>
这只是 list-[var(<自定义属性>)]
的简写,它会自动为您添加 var()
函数。
前缀a list-style-type
实用工具 与断点变体(如 md:
)一起使用,以便仅在中等 屏幕尺寸及以上尺寸应用该实用工具
<ul class="list-none md:list-disc ..."> <!-- ... --></ul>
了解有关在变体文档中使用变体的更多信息。