Typography

list-style-type

用於控制列表標記樣式的通用類別。

ClassStyles
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>;

範例(Examples)

基本範例(Basic example)

使用 list-disclist-decimal 等通用類別來控制列表中標記的樣式:

list-disc
  • Now this is a story all about how, my life got flipped-turned upside down
  • And I'd like to take a minute just sit right there
  • I'll tell you how I became the prince of a town called Bel-Air
list-decimal
  • Now this is a story all about how, my life got flipped-turned upside down
  • And I'd like to take a minute just sit right there
  • I'll tell you how I became the prince of a town called Bel-Air
list-none
  • Now this is a story all about how, my life got flipped-turned upside down
  • And I'd like to take a minute just sit right there
  • I'll tell you how I became the prince of a town called Bel-Air
<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>

使用自訂值(Using a custom value)

使用 list-[<value>] 語法,根據完全自訂的值來設定 marker

<ol class="list-[upper-roman] ...">  <!-- ... --></ol>

對於 CSS 變數,你也可以使用 list-(<custom-property>) 語法:

<ol class="list-(--my-marker) ...">  <!-- ... --></ol>

這只是 list-[var(<custom-property>)] 的簡寫形式,會自動為你加上 var() 函式。

響應式設計(Responsive design)

list-style-type 通用類別前面加上像 md: 這樣的中斷點變體,讓該通用類別只在中型螢幕尺寸及以上時套用:

<ul class="list-none md:list-disc ...">  <!-- ... --></ul>

變體文件中了解更多關於使用變體的資訊。

Copyright © 2026 Tailwind Labs Inc.·商標政策(Brand)