--- title: list-style slug: Web/CSS/list-style translation_of: Web/CSS/list-style --- <div>{{CSSRef}}</div> <div><strong><code>list-style</code></strong> CSS 属性是一个简写对属性集合,包括{{cssxref("list-style-type")}}, {{cssxref("list-style-image")}}, 和 {{cssxref("list-style-position")}}。</div> <h2 id="Summary" name="Summary">概要</h2> <p>CSS list-style 属性是设置{{cssxref("list-style-type")}}, {{cssxref("list-style-image")}} 和 {{cssxref("list-style-position")}} 的简写属性。</p> <p>{{cssinfo}}</p> <h2 id="Syntax" name="Syntax">语法</h2> <pre class="syntaxbox"><a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("list-style")}}</pre> <h3 id="Values" name="Values">值</h3> <p>以任何顺序接受一个,二个或者三个关键词</p> <dl> <dt><code><'list-style-type'></code></dt> <dd>参看 {{cssxref("list-style-type")}}</dd> <dt><code><'list-style-image'></code></dt> <dd>参看 {{cssxref("list-style-image")}}</dd> <dt><code><'list-style-position'></code></dt> <dd>参看 {{cssxref("list-style-position")}}</dd> </dl> <h2 id="示例">示例</h2> <h3 id="HTML">HTML</h3> <pre class="brush: 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> </pre> <h3 id="CSS">CSS</h3> <pre class="brush: css">.one { list-style: circle; } .two { list-style: square inside; }</pre> <h3 id="Result">Result</h3> <p>{{EmbedLiveSample('示例')}}</p> <h2 id="Specifications" name="Specifications">规范</h2> <table class="standard-table"> <thead> <tr> <th scope="col">规范</th> <th scope="col">状态</th> <th scope="col">注释</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS3 Lists', '#list-style', 'list-style')}}</td> <td>{{Spec2('CSS3 Lists')}}</td> <td>没有改变</td> </tr> <tr> <td>{{SpecName('CSS2.1', 'generate.html#propdef-list-style', 'list-style')}}</td> <td>{{Spec2('CSS2.1')}}</td> <td>初始定义</td> </tr> </tbody> </table> <h2 id="浏览器兼容性">浏览器兼容性</h2> <div>{{CompatibilityTable}}</div> <div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>{{CompatGeckoDesktop("1")}}</td> <td>4.0</td> <td>7.0</td> <td>1.0</td> </tr> </tbody> </table> </div> <div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>{{CompatGeckoMobile("1")}}</td> <td>6.0</td> <td>6.0</td> <td>1.0</td> </tr> </tbody> </table> </div> <h2 id="See_also" name="See_also">另参见</h2> <ul> <li>{{Cssxref("list-style-type")}}, {{Cssxref("list-style-image")}}, {{Cssxref("list-style-position")}}</li> </ul>