登录  /  注册
首页 > web前端 > css教程 > 正文

CSS:list-style-type的使用方法详解

黄舟
发布: 2018-05-23 16:03:16
原创
5743人浏览过

这篇文章主要介绍了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 :

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

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

示例

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的使用方法详解的详细内容,更多请关注php中文网其它相关文章!

智能AI问答
PHP中文网智能助手能迅速回答你的编程问题,提供实时的代码和解决方案,帮助你解决各种难题。不仅如此,它还能提供编程资源和学习指导,帮助你快速提升编程技能。无论你是初学者还是专业人士,AI智能助手都能成为你的可靠助手,助力你在编程领域取得更大的成就。
相关标签:
css
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
关于CSS思维导图的课件在哪? 课件
凡人来自于2024-04-16 10:10:18
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号