概要
CSS list-style 属性是设置list-style-type
, list-style-image
和 list-style-position
的简写属性。
初始值 | as each of the properties of the shorthand:
|
---|---|
适用元素 | list items |
是否是继承属性 | yes |
计算值 | as each of the properties of the shorthand:
|
Animation type | discrete |
语法
值
以任何顺序接受一个,二个或者三个关键词
<'list-style-type'>
- 参看
list-style-type
<'list-style-image'>
- 参看
list-style-image
<'list-style-position'>
- 参看
list-style-position
示例
HTML
List 1
<ul class="one">
<li>List Item1</li>
<li>List Item2</li>
<li>List Item3</li>
</ul>
List 2
<ul class="two">
<li>List Item A</li>
<li>List Item B</li>
<li>List Item C</li>
</ul>
CSS
.one {
list-style: circle;
}
.two {
list-style: square inside;
}
Result
规范
规范 | 状态 | 注释 |
---|---|---|
CSS Lists Module Level 3 list-style |
Working Draft | 没有改变 |
CSS Level 2 (Revision 1) list-style |
Recommendation | 初始定义 |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 | 1.0 (1.7 or earlier) | 4.0 | 7.0 | 1.0 |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | 1.0 | 1.0 (1) | 6.0 | 6.0 | 1.0 |