list-style-type

CSS 属性 list-style-type 可以设置列表元素的标记(比如圆点、符号、或者自定义计数器样式)。

示例

/* Partial list of types */
list-style-type: disc;
list-style-type: circle;
list-style-type: square;
list-style-type: decimal;
list-style-type: georgian;
list-style-type: trad-chinese-informal;
list-style-type: kannada;

/*  value */
list-style-type: '-';

/* Identifier matching an @counter-style rule */
list-style-type: custom-counter-style;

/* Keyword value */
list-style-type: none;

/* Global values */
list-style-type: inherit;
list-style-type: initial;
list-style-type: unset;

浏览器支持

IE浏览器 火狐浏览器 opera浏览器 chrome浏览器 safari浏览器
浏览器都支持 list-style-type

语法:

list-style-type <custom-ident> | symbols() | <string> | disc | circle | square | decimal | decimal-leading-zero | 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

取值:

  • <custom-ident> :与@counter样式或预定义样式之一的值匹配的标识符。参见 <custom-ident>
  • symbols() :定义列表的匿名样式
  • <string> :指定的字符串将用作项的标记。
  • none:不显示列表项的标记。

关键字的取值是下列之一:

效果 取值 含义
  • 第一行
  • 第二行
disc 实心圆
  • 第一行
  • 第二行
circle 空心圆
  • 第一行
  • 第二行
square 实心方块
  • 第一行
  • 第二行
decimal 阿拉伯数字
  • 第一行
  • 第二行
cjk-decimal 中日韩十进制数例如:一,二,三,...,九八,九九,一〇〇
  • 第一行
  • 第二行
decimal-leading-zero 十进制数。由初始零填充。例如01, 02, 03,… 98, 99
  • 第一行
  • 第二行
lower-roman 小写罗马数字
  • 第一行
  • 第二行
upper-roman 大写罗马数字
  • 第一行
  • 第二行
lower-alpha 小写英文字母
  • 第一行
  • 第二行
upper-alpha 大写英文字母
  • 第一行
  • 第二行
armenian 传统的亚美尼亚数字
  • 第一行
  • 第二行
cjk-ideographic 浅白的表意数字
  • 第一行
  • 第二行
georgian 传统的乔治数字
  • 第一行
  • 第二行
lower-greek 基本的希腊小写字母
  • 第一行
  • 第二行
hebrew 传统的希伯莱数字
  • 第一行
  • 第二行
hiragana 日文平假名字符
  • 第一行
  • 第二行
hiragana-iroha 日文平假名序号
  • 第一行
  • 第二行
katakana 日文片假名字符
  • 第一行
  • 第二行
lower-alpha
lower-latin
小写拉丁字母
  • 第一行
  • 第二行
upper-alpha
upper-latin
大写拉丁字母

说明:

设置或检索对象的列表项所使用的预设标记。

  • list-style-image 属性为 none 或指定图像不可用时, list-style-type 属性将发生作用。
  • 仅作用于具有 display:list-item 的对象(如li对象)。
  • 注意:ol对象和ul对象的type特性为其后的所有列表项目(如li对象)指明列表属性。
  • 对应的脚本特性为 listStyleType
默认值 disc
适用于 所有 display:list-item 的元素
继承性
动画性
计算值 特定值

实例

<style>
ol.normal {
  list-style-type: upper-alpha;
}

/* or use the shortcut "list-style": */
ol.shortcut {
  list-style: upper-alpha;
}
</style>

<ol class="normal">List 1
  <li>Hello</li>
  <li>World</li>
  <li>What's up?</li>
</ol>

<ol class="shortcut">List 2
  <li>Looks</li>
  <li>Like</li>
  <li>The</li>
  <li>Same</li>
</ol>