設定列表項目(<li>、display: list-item)的前置標記樣式。當 list-style-image 為 none 或圖片無法載入時生效。
| 關鍵字 | 外觀 | 適用場景 |
|---|---|---|
disc | ● 實心圓 | 預設無序列表 |
circle | ○ 空心圓 | 巢狀第二層 |
square | ■ 實心方塊 | 巢狀第三層 |
decimal | 1, 2, 3... | 有序列表預設 |
lower-roman | i, ii, iii... | 附錄、腳註 |
upper-roman | I, II, III... | 章節大綱 |
lower-alpha / lower-latin | a, b, c... | 子項目 |
upper-alpha / upper-latin | A, B, C... | 主要項目 |
none | 無標記 | 自訂圖示、導航選單 |
| 關鍵字 | 文字系統 | 範例 |
|---|---|---|
armenian | 亞美尼亞數字 | Ա, Բ, Գ... |
georgian | 喬治亞數字 | ა, ბ, გ... |
cjk-ideographic | 中日韓表意數字 | 一, 二, 三... |
hiragana | 日文平假名 | あ, い, う... |
hiragana-iroha | 平假名伊呂波順 | い, ろ, は... |
katakana | 日文片假名 | ア, イ, ウ... |
katakana-iroha | 片假名伊呂波順 | イ, ロ, ハ... |
lower-greek | 希臘小寫字母 | α, β, γ... |
hebrew | 希伯來數字 | א, ב, ג... |
| 關鍵字 | 說明 |
|---|---|
decimal-leading-zero | 01, 02, 03... |
cjk-decimal | 中日韓十進制數字 |
lower-alpha / upper-alpha | 標準化別名(同 lower-latin/upper-latin) |
ethiopic-numeric | 衣索比亞數字系統 |
japanese-formal | 日文正式數字(壹、貳、參) |
korean-hangul-formal | 韓文正式數字 |
simp-chinese-formal | 簡體中文正式數字 |
trad-chinese-formal | 繁體中文正式數字(壹、貳、參) |
simp-chinese-informal | 簡體中文非正式(一、二、三) |
trad-chinese-informal | 繁體中文非正式 |
使用 counter-reset、counter-increment、content: counter(name) 實現任意編號格式。
ol.chinese-paren {
list-style: none;
counter-reset: item;
}
ol.chinese-paren li::before {
counter-increment: item;
content: "(" counter(item, trad-chinese-informal) ") ";
/* 需瀏覽器支援 trad-chinese-informal,否則用自定映射 */
}
ol.multi {
list-style: none;
counter-reset: level1;
}
ol.multi > li {
counter-increment: level1;
}
ol.multi > li::before {
content: counter(level1) ". ";
}
ol.multi ol {
counter-reset: level2;
}
ol.multi ol li::before {
counter-increment: level2;
content: counter(level1) "." counter(level2) " ";
}
list-style: type position image;
/* 例 */
ul { list-style: disc inside none; }
ol { list-style: decimal outside url(bullet.svg); }
position:outside(預設,標記在內容外)、inside(標記在內容流內)。image:優先於 type。ul, ol { list-style: none; padding-left: 1.5rem; } 統一由設計系統控制。list-style: none。decimal 或自訂計數器。lang 屬性動態切換 list-style-type(如中文用 cjk-decimal、日文用 japanese-formal)。list-style-type 提供豐富的預設標記風格,涵蓋拉丁、希臘、西里爾、中日韓、希伯來、亞美尼亞、喬治亞、衣索比亞等文字系統。現代開發多搭配 list-style: none + ::before + CSS 計數器 / SVG 圖示,實現完全可控、可設計、可無障礙的列表視覺系統。