📜  CSS | list-style-type 属性

📅  最后修改于: 2021-09-01 02:19:22             🧑  作者: Mango

如果 ‘list-style-image’ 的值为 ‘none’,则 CSS 中的list-style-type属性指定列表项标记的外观(例如圆盘、字符或自定义计数器样式)。

句法:

list-style-type: disc|circle|square|decimal|lower-roman|upper-roman|
lower-greek|lower-latin|upper-latin|lower-alpha|upper-alpha|none|
inherit;

属性值

  • 光盘:这是默认值。标记是一个实心圆圈。
    句法:
    list-style-type: disc;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: disc;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    光盘

  • 圆:标记是一个空心圆。
    句法:
    list-style-type: circle;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: circle;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    圆圈

  • 正方形:标记是正方形。
    句法:
    list-style-type: square;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: square;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    正方形

  • 十进制:标记是十进制数字,以 1 开头。
    句法:
    list-style-type: decimal;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: decimal;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    十进制

  • lower-roman:标记是小写的罗马数字(i、ii、iii、iv、v 等)。

    句法:

    list-style-type: lower-roman;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: lower-roman;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    低罗马

  • upper-roman:标记是大写的罗马数字(I、II、III、IV、V 等)。

    句法:

    list-style-type: upper-roman;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: upper-roman;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    上罗马

  • lower-greek:标记是小写的古典希腊字母 alpha、beta、gamma、… (?, ?, ?, …)。

    句法:

    list-style-type: lower-greek;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: lower-greek;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    下希腊语

  • lower-latin:标记是小写的 ascii 字母 (a, b, c, … z)。

    句法:

    list-style-type: lower-latin;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: lower-latin;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    低拉丁

  • upper-latin:标记是大写的 ascii 字母 (A, B, C, … Z)。

    句法:

    list-style-type: upper-latin;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: upper-latin;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    上拉丁语

  • none:此模式下不显示标记。
    句法:
    list-style-type: none;

    例子:

    
    
        
            CSS list-style-type Property
            
        
        
        

            list-style-type: none;     

        

    Sorting Algorithms

        
            
    • Bubble Sort
    •       
    • Merge Sort
    •       
    • Insertion Sort
    •     
               

    输出:
    没有任何

注: lower-alphaupper-alpha分别与lower-latin 和upper-latin 相同。
支持的浏览器: list-style-type 属性支持的浏览器如下:

  • 谷歌浏览器 1.0
  • 浏览器 4.0
  • 火狐 1.0
  • 歌剧7.0
  • 苹果 Safari 1.0