語法
list-style-type: disc | circle | square | decimal | lower-roman | upper-roman |
lower-alpha | upper-alpha | none | armenian | cjk-ideographic |
georgian | lower-greek | hebrew | hiragana | hiragana-iroha |
katakana | katakana-iroha | lower-latin | upper-latin;
屬性值完整對照表
| 值 | CSS 版本 | 外觀說明 |
disc | CSS1 | 實心圓 ●(預設值) |
circle | CSS1 | 空心圓 ○ |
square | CSS1 | 實心方塊 ■ |
decimal | CSS1 | 阿拉伯數字 1, 2, 3… |
lower-roman | CSS1 | 小寫羅馬數字 i, ii, iii… |
upper-roman | CSS1 | 大寫羅馬數字 I, II, III… |
lower-alpha / lower-latin | CSS1 / CSS2 | 小寫英文字母 a, b, c… |
upper-alpha / upper-latin | CSS1 / CSS2 | 大寫英文字母 A, B, C… |
none | CSS1 | 無項目符號 |
armenian | CSS2 | 傳統亞美尼亞數字 |
cjk-ideographic | CSS2 | 簡體表意數字(一、二、三…) |
georgian | CSS2 | 傳統喬治亞數字 |
lower-greek | CSS2 | 基本希臘小寫字母 α, β, γ… |
hebrew | CSS2 | 傳統希伯來數字 |
hiragana | CSS2 | 日文平假名字符 あ, い, う… |
hiragana-iroha | CSS2 | 日文平假名序號 い, ろ, は… |
katakana | CSS2 | 日文片假名字符 ア, イ, ウ… |
katakana-iroha | CSS2 | 日文片假名序號 イ, ロ, ハ… |
重要特性與注意事項
- 僅作用於
display: list-item 的元素(預設 <li>)。
- 當
list-style-image 為 none 或圖片無法載入時,list-style-type 才生效。
<ol>、<ul> 的 type 屬性會影響後代 <li>,但 CSS 優先級高於 HTML 屬性。
- IE5.5 不支援 CSS2 新增值(如
cjk-ideographic 等)。
- 對應 JavaScript 屬性:
element.style.listStyleType。
實務建議
- 現代網頁常搭配
list-style: none 移除預設符號,改用 ::before 偽元素 + 自訂圖示/圖片,靈活度最高。
- 中文文書建議使用
cjk-ideographic 或自訂中文數字計數器(@counter-style)。
- 巢狀列表可結合
counter-reset、counter-increment 實現多層級編號(如 1.1、1.2)。