--- title: list-style slug: Web/CSS/list-style translation_of: Web/CSS/list-style ---
{{CSSRef}}
list-style CSS 属性是一个简写对属性集合,包括{{cssxref("list-style-type")}}, {{cssxref("list-style-image")}}, 和 {{cssxref("list-style-position")}}。

概要

CSS list-style 属性是设置{{cssxref("list-style-type")}}, {{cssxref("list-style-image")}} 和 {{cssxref("list-style-position")}}  的简写属性。

{{cssinfo}}

语法

Formal syntax: {{csssyntax("list-style")}}

以任何顺序接受一个,二个或者三个关键词

<'list-style-type'>
参看 {{cssxref("list-style-type")}}
<'list-style-image'>
参看 {{cssxref("list-style-image")}}
<'list-style-position'>
参看 {{cssxref("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

{{EmbedLiveSample('示例')}}

规范

规范 状态 注释
{{SpecName('CSS3 Lists', '#list-style', 'list-style')}} {{Spec2('CSS3 Lists')}} 没有改变
{{SpecName('CSS2.1', 'generate.html#propdef-list-style', 'list-style')}} {{Spec2('CSS2.1')}} 初始定义

浏览器兼容性

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 {{CompatGeckoDesktop("1")}} 4.0 7.0 1.0
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 1.0 {{CompatGeckoMobile("1")}} 6.0 6.0 1.0

另参见