服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - 编程技术 - CSS list-style-type属性使用方法

CSS list-style-type属性使用方法

2023-05-22 17:25编程技术网 编程技术

这篇文章主要介绍了CSS list-style-type属性使用方法,需要的朋友可以参考下

设置对象的行项标记的预定义类型。

语法

{ list-style-type: sType }

可能的值
sType

一个字符串,用于指定以下值之一:


disc

默认值。实心圆。

circle

空心圆。

decimal

1、2、3、4 等等。

lower-alpha

a、b、c、d 等等。

lower-roman

i、ii、iii、iv 等等。

none

不显示任何标记。

square

实心正方形。

upper-alpha

A、B、C、D 等等。

upper-roman

I、II、III、IV 等等。

该属性的默认值为 disc 。该属性会被继承。

注解

如果 list-style-image 属性的值设置为 none ,或者无法显示 URL 指向的图像,则 list-style-type 属性决定 list-item 标记的外观。
list-style-type 属性可在应用 margin 和 display:list-item 属性之后应用于任何元素。
如果使用其中一个 margin 属性将行项的左边距设置为 0,则不会显示列表项标记。该边距至少应设置为 30 磅。

示例

下面的示例使用 list-style-type 属性设置标记。本示例在内嵌(全局)样式表中使用 UL 元素作为选择器,以将标记类型更改为 circle :

?
1
2
3
<style>
ul {list-style-type:circle}
</style>

list-style-type -- 定义列表样式

取值:disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit

  1. disc: 点
  2. circle: 圆圈
  3. square: 正方形
  4. decimal: 数字
  5. decimal-leading-zero: 十进制数,不足两位的补齐前导0,例如: 01, 02, 03, ..., 98, 99
  6. lower-roman: 小写罗马文字,例如: i, ii, iii, iv, v, ...
  7. upper-roman: 大写罗马文字,例如: I, II, III, IV, V, ...
  8. lower-greek: 小写希腊字母,例如: α(alpha), β(beta), γ(gamma), ...
  9. lower-latin: 小写拉丁文,例如: a, b, c, ... z
  10. upper-latin: 大写拉丁文,例如: A, B, C, ... Z
  11. armenian: 亚美尼亚数字
  12. georgian: 乔治亚数字,例如: an, ban, gan, ..., he, tan, in, in-an, ...
  13. lower-alpha: 小写拉丁文,例如: a, b, c, ... z
  14. upper-alpha: 大写拉丁文,例如: A, B, C, ... Z
  15. none: 无(取消所有的list样式)
  16. inherit:继承

初始值: disc

继承性: 是
适用于: 所有属于list的元素
list,中文"列表"的意思.style,中文"样式"的意思.type,中文"类型"的意思.

示例

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ul   
{   
    list-style-type:disc;  
}  
   
ul#circle 
{   
    list-style-type:circle;  
}  
   
ul#square 
{   
    list-style-type:square;  
}  
   
ul#decimal  
{   
    list-style-type:decimal;  
}  
   
ul#decimal-leading-zero  
{   
    list-style-type:decimal-leading-zero;  
}  
   
ul#lower-roman  
{   
    list-style-type:lower-roman;  
}  
   
ul#upper-roman  
{   
    list-style-type:upper-roman;  
}  
   
ul#lower-greek  
{   
    list-style-type:lower-greek;  
}  
   
ul#lower-latin  
{   
    list-style-type:lower-latin;  
}  
   
ul#upper-latin  
{   
    list-style-type:upper-latin;  
}  
   
ul#armenian  
{   
    list-style-type:armenian;  
}  
   
ul#georgian  
{   
    list-style-type:georgian;  
}  
   
ul#lower-alpha  
{   
    list-style-type:lower-alpha;  
}  
   
ul#upper-alpha  
{   
    list-style-type:upper-alpha;  
}  
   
ul#none 
{   
    list-style-type:none;  
}  
   
ol   
{   
    list-style-type:lower-roman;  
}

到此这篇关于CSS list-style-type属性使用方法的文章就介绍到这了,更多相关CSS list-style-type内容请搜索服务器之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持服务器之家!

延伸 · 阅读

精彩推荐