CINXE.COM

CSS list-style

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="keywords" content="CSS list-style, image for list items, indent, disc, custom, li, ul, ol, examples, stylesheets"> <meta name="Description" content="CSS list-style - CSS shorthand property for specifying styles for list items."> <link rel="canonical" href="https://www.quackit.com/css/properties/css_list-style.cfm"> <title>CSS list-style</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <link rel="shortcut icon" href="/pix/favicon96.png"> <link rel="apple-touch-icon" href="/pix/apple-touch-icon.png"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet"> <link href="/common/css/master.45.min.css" rel="stylesheet"> <script async src="https://cdn.fuseplatform.net/publift/tags/2/3499/fuse.js"></script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-Q3H025ZKLN"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-Q3H025ZKLN'); </script> </head> <body> <header class="site-header"> <div class="site-header-base"> <div class="site-logo"> <a title="Quackit Homepage" target="_top" href="/"><img src="/pix/quackit_logo_watermark.png" width="87" height="33" alt="Quackit Logo"></a> </div> <button id="site-nav-toggler" class="site-nav-toggler" aria-expanded="false" aria-controls="site-nav"> <span class="sr-only">Toggle navigation</span> &#9776; </button> </div> <nav id="site-nav" class="site-nav"> <div class="site-links"> <ul> <li><a href="/"><i class="fa fa-home"></i> <span class="sr-only">Home</span></a></li> <li><a href="/html/">HTML</a></li> <li><a href="/css/">CSS</a></li> <li><a href="/scripting/">Scripting</a></li> <li><a href="/database/">Database</a></li> </ul> </div> <div class="site-search-top"> <form action="/search/" id="cse-search-box-bottom" class="site-search"> <div> <input type="hidden" name="cx" value="partner-pub-6331358926293806:98x0fk-bbgi"> <input type="hidden" name="cof" value="FORID:10"> <input type="hidden" name="ie" value="ISO-8859-1"> <input type="text" name="q" size="20" class="site-search-input"> <button type="submit" name="sa" class="site-search-button"><i class="fa fa-search"></i></button> </div> </form> </div> </nav> </header> <div class="main"> <article class="content"> <h1 class="page-title">CSS list-style</h1> <div class="ad ad-top"> <!-- GAM 71161633/QCKIT_quackit/article_header --> <div data-fuse="23059883623"></div> </div> <script src="/common/js/codemirror/lib/codemirror.js"></script> <script src="/common/js/codemirror/mode/css/css.js"></script> <div class="code-only"> <textarea id="example1" autocomplete="off" spellcheck="false">&lt;&#x21;doctype html&gt;&#xd;&#xa;&lt;title&gt;Example&lt;&#x2f;title&gt;&#xd;&#xa;&lt;style&gt;&#xd;&#xa; ul &#x7b; &#xd;&#xa; list-style&#x3a; square inside&#x3b;&#xd;&#xa; font-size&#x3a; 2em&#x3b;&#xd;&#xa; color&#x3a; darkorange&#x3b; &#xd;&#xa; &#x7d;&#xd;&#xa;&lt;&#x2f;style&gt;&#xd;&#xa;&lt;p&gt;The &lt;code&gt;list-style&lt;&#x2f;code&gt; property is shorthand for&#x3a;&lt;&#x2f;p&gt;&#xd;&#xa;&lt;ul&gt;&#xd;&#xa; &lt;li&gt;list-style-type&lt;&#x2f;li&gt;&#xd;&#xa; &lt;li&gt;list-style-position&lt;&#x2f;li&gt;&#xd;&#xa; &lt;li&gt;list-style-image&lt;&#x2f;li&gt;&#xd;&#xa;&lt;&#x2f;ul&gt;</textarea> <p> <a class="btn btn-default" href="/html/html_editors/scratchpad/?example=/css/properties/css_list-style" target="_blank" title="Full-page editor. Opens this example in the full-page editor."><i class="fa fa-pencil-square-o"></i> View Output</i></a> </p> </div> <script> var exampleCode1 = CodeMirror.fromTextArea(document.getElementById("example1"), { mode: "text/css", tabMode: "indent", styleActiveLine: false, lineNumbers: false, lineWrapping: true, theme: "q-dark" }); </script> <p class="lead">The CSS <code>list-style</code> property is a shorthand property for specifying styles for list items. </p> <p>The <code>list-style</code> property is shorthand for the <a href="/css/properties/css_list-style-type.cfm"><code>list-style-type</code></a>, <a href="/css/properties/css_list-style-position.cfm"><code>list-style-position</code></a> and <a href="/css/properties/css_list-style-image.cfm"><code>list-style-image</code></a> properties.</p> <div class="ad"> <!-- GAM 71161633/QCKIT_quackit/article_incontent_1 --> <div data-fuse="23059883629"></div> </div> <h2>Syntax</h2> <script src="/common/js/codemirror/mode/text/css/text/css.js"></script> <div class="code-only"> <textarea id="example2" autocomplete="off" spellcheck="false">list-style&#x3a; &lt;&#x27;list-style-type&#x27;&gt; &#x7c;&#x7c; &lt;&#x27;list-style-position&#x27;&gt; &#x7c;&#x7c; &lt;&#x27;list-style-image&#x27;&gt;</textarea> </div> <script> var exampleCode2 = CodeMirror.fromTextArea(document.getElementById("example2"), { mode: "text/css", tabMode: "indent", styleActiveLine: false, lineNumbers: false, lineWrapping: true, theme: "q-dark" }); </script> <p>These values are explained below.</p> <h2>Possible Values</h2> <dl> <dt><dfn><a href="/css/properties/css_list-style-type.cfm"><var class="css-data-type">'list-style-type'</var></a></dfn></dt> <dd> <p>Provides the value for the <a href="/css/properties/css_list-style-type.cfm"><code>list-style-type</code></a> property.</p> <p>You can specify the list style type as one of the predefined counter styles (e.g., a disc, square, roman numerals, etc) or you can use your own customized counter style. You can create your own custom counter style with the <a href="/css/at-rules/css_counter-style_at-rule.cfm"><code>@counter-style</code></a> at-rule, then refer to that style in <code>list-style</code> by simply adding that counter style's name as the first value.</p> <p>You can also provide a <a href="/css/data_types/css_string_data_type.cfm"><var class="css-data-type">string</var></a> as the value (the string becomes the marker) or use the <a href="/css/functions/css_symbols_function.cfm"><code>symbols()</code></a> function as a quick way to add a custom marker style.</p> <p>See <a href="/css/properties/css_list-style-type.cfm"><code>list-style-type</code></a> for more detail and examples.</p> </dd> <dt><dfn><a href="/css/properties/css_list-style-position.cfm"><var class="css-data-type">'list-style-position'</var></a></dfn></dt> <dd> <p>Provides the value for the <a href="/css/properties/css_list-style-position.cfm"><code>list-style-position</code></a> property. This property allows you to control the position of the <code>::marker</code> pseudo-element in the list item.</p> </dd> <dt><dfn><a href="/css/properties/css_list-style-image.cfm"><var class="css-data-type">'list-style-image'</var></a></dfn></dt> <dd> <p>Provides the value for the <a href="/css/properties/css_list-style-image.cfm"><code>list-style-image</code></a> property. This property is used to specify an image to be used as a list marker's default contents.</p> </dd> </dl> <p>In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value: </p> <dl> <dt><code>initial</code></dt> <dd>Represents the value specified as the property's initial value.</dd> <dt><code>inherit</code></dt> <dd>Represents the computed value of the property on the element's parent.</dd> <dt><code>unset</code></dt> <dd>This value acts as either <code>inherit</code> or <code>initial</code>, depending on whether the property is inherited or not. In other words, it sets all properties to their parent value if they are inheritable or to their initial value if not inheritable.</dd> </dl> <h2>General Information</h2> <div class="specifications"> <dl> <dt>Initial Value</dt> <dd>Depends on the value of the individual properties. Their initial values are as follows: <dl> <dt><a href="/css/properties/css_list-style-type.cfm"><code>list-style-type</code></a></dt> <dd><code>disc</code></dd> <dt><a href="/css/properties/css_list-style-position.cfm"><code>list-style-position</code></a></dt> <dd><code>outside</code></dd> <dt><a href="/css/properties/css_list-style-image.cfm"><code>list-style-image</code></a></dt> <dd><code>none</code></dd> </dl> </dd> <dt>Applies To</dt> <dd>List item elements</dd> <dt>Inherited?</dt> <dd>Yes</dd> <dt>Media</dt> <dd>Visual</dd> </dl> </div> <h2>Example Code</h2> <div class="code-only"> <textarea id="example3" autocomplete="off" spellcheck="false">&#x2f;&#x2a; Use a predefined style. The marker position defaults at &#x27;outside&#x27;. &#x2a;&#x2f;&#xd;&#xa;ol &#x7b; &#xd;&#xa; list-style&#x3a; lower-roman&#x3b; &#xd;&#xa; &#x7d;&#xd;&#xa;&#xd;&#xa;&#x2f;&#x2a; Specify a marker position of &#x27;inside&#x27; &#x2a;&#x2f;&#xd;&#xa;ol &#x7b; &#xd;&#xa; list-style&#x3a; lower-roman inside&#x3b; &#xd;&#xa; &#x7d;&#xd;&#xa; &#xd;&#xa;&#x2f;&#x2a; Specify an image for the marker &#x2a;&#x2f;&#xd;&#xa;ul &#x7b; &#xd;&#xa; list-style&#x3a; url&#x28;bullet.png&#x29;&#x3b; &#xd;&#xa; &#x7d;&#xd;&#xa; &#xd;&#xa;&#x2f;&#x2a; Define and use a custom counter style &#x2a;&#x2f;&#xd;&#xa;&#x40;counter-style dice &#x7b;&#xd;&#xa; system&#x3a; additive&#x3b;&#xd;&#xa; additive-symbols&#x3a; 6 &quot;&#x5c;2685&quot;, 5 &quot;&#x5c;2684&quot;, 4 &quot;&#x5c;2683&quot;, 3 &quot;&#x5c;2682&quot;, 2 &quot;&#x5c;2681&quot;, 1 &quot;&#x5c;2680&quot;&#x3b;&#xd;&#xa; suffix&#x3a; &quot; &quot;&#x3b;&#xd;&#xa; speak-as&#x3a; numbers&#x3b;&#xd;&#xa; fallback&#x3a; square&#x3b;&#xd;&#xa;&#x7d; &#xd;&#xa;&#xd;&#xa;ol &#x7b; &#xd;&#xa; list-style&#x3a; dice&#x3b;&#xd;&#xa;&#x7d;</textarea> </div> <script> var exampleCode3 = CodeMirror.fromTextArea(document.getElementById("example3"), { mode: "text/css", tabMode: "indent", styleActiveLine: false, lineNumbers: false, lineWrapping: true, theme: "q-dark" }); </script> <h2>Official Specifications</h2> <ul> <li><a href="https://www.w3.org/TR/css-counter-styles-3/">CSS Counter Styles Level 3</a> (W3C Candidate Recommendation, 11 June 2015)</li> <li><a href="https://www.w3.org/TR/css-lists-3/#propdef-list-style">CSS Lists and Counters Module Level 3</a> (W3C Working Draft)</li> <li><a href="https://www.w3.org/TR/CSS21/generate.html#propdef-list-style">CSS Level 2.1</a> (W3C Recommendation 07 June 2011)</li> <li><a href="https://www.w3.org/TR/REC-CSS1/#list-style">CSS Level 1</a> (W3C Recommendation 17 Dec 1996)</li> </ul> </article> <div class="sidebar"> <nav> <ul> <li> <h3><a href="/css/properties/">CSS Properties</a></h3> <ul> <li><a href="/css/css3/properties/css_animation.cfm">animation</a></li> <li><a href="/css/properties/css_background.cfm">background</a></li> <li><a href="/css/css3/properties/css_bleed.cfm">bleed</a></li> <li><a href="/css/css3/properties/css_border-radius.cfm">border-radius</a></li> <li><a href="/css/properties/css_border.cfm">border</a></li> <li><a href="/css/css3/properties/css_box-shadow.cfm">box-shadow</a></li> <li><a href="/css/css3/properties/css_box-sizing.cfm">box-sizing</a></li> <li><a href="/css/properties/css_clear.cfm">clear</a></li> <li><a href="/css/properties/css_clip.cfm">clip</a></li> <li><a href="/css/properties/css_color.cfm">color</a></li> <li><a href="/css/css3/properties/css_columns.cfm">columns</a></li> <li><a href="/css/properties/css_content.cfm">content</a></li> <li><a href="/css/properties/css_counter-increment.cfm">counter-increment</a></li> <li><a href="/css/properties/css_cue.cfm">cue</a></li> <li><a href="/css/properties/css_cursor.cfm">cursor</a></li> <li><a href="/css/properties/css_display.cfm">display</a></li> <li><a href="/css/css3/properties/css_filter.cfm">filter</a></li> <li><a href="/css/css3/properties/css_flex.cfm">flex</a></li> <li><a href="/css/properties/css_float.cfm">float</a></li> <li><a href="/css/properties/css_font-family.cfm">font-family</a></li> <li><a href="/css/properties/css_font-size.cfm">font-size</a></li> <li><a href="/css/properties/css_font.cfm">font</a></li> <li><a href="/css/properties/css_height.cfm">height</a></li> <li><a href="/css/properties/css_left.cfm">left</a></li> <li><a href="/css/properties/css_list-style.cfm">list-style</a></li> <li><a href="/css/properties/css_margin.cfm">margin</a></li> <li><a href="/css/css3/properties/css_mix-blend-mode.cfm">mix-blend-mode</a></li> <li><a href="/css/css3/properties/css_opacity.cfm">opacity</a></li> <li><a href="/css/properties/css_outline.cfm">outline</a></li> <li><a href="/css/css3/properties/css_overflow.cfm">overflow</a></li> <li><a href="/css/properties/css_padding.cfm">padding</a></li> <li><a href="/css/properties/css_page.cfm">page</a></li> <li><a href="/css/properties/css_pause.cfm">pause</a></li> <li><a href="/css/css3/properties/css_perspective.cfm">perspective</a></li> <li><a href="/css/properties/css_position.cfm">position</a></li> <li><a href="/css/css3/properties/css_rest.cfm">rest</a></li> <li><a href="/css/properties/css_right.cfm">right</a></li> <li><a href="/css/properties/css_text-align.cfm">text-align</a></li> <li><a href="/css/css3/properties/css_text-decoration.cfm">text-decoration</a></li> <li><a href="/css/properties/css_text-shadow.cfm">text-shadow</a></li> <li><a href="/css/properties/css_top.cfm">top</a></li> <li><a href="/css/css3/properties/css_transform.cfm">transform</a></li> <li><a href="/css/css3/properties/css_transition.cfm">transition</a></li> <li><a href="/css/properties/css_vertical-align.cfm">vertical-align</a></li> <li><a href="/css/properties/css_visibility.cfm">visibility</a></li> <li><a href="/css/properties/css_width.cfm">width</a></li> <li><a href="/css/css3/properties/css_word-wrap.cfm">word-wrap</a></li> <li><a href="/css/properties/css_z-index.cfm">z-index</a></li> <li><a href="/css/properties/">All Properties <i class="fa fa-long-arrow-right" aria-hidden="true"></i></a></li> </ul> </li> <li> <h3><a href="/css/reference/">CSS Reference</a></h3> <ul> <li><a href="/css/examples/" title="Copy &amp; paste code examples.">CSS Examples</a></li> <li><a href="/css/properties/" title="All CSS properties listed alphabetically.">CSS Properties</a></li> <li><a href="/css/functions/" title="All CSS functions listed alphabetically.">CSS Functions</a></li> <li><a href="/css/data_types/" title="">CSS Data Types</a></li> <li><a href="/css/at-rules/" title="">CSS @-Rules</a></li> <li><a href="/css/selectors/" title="All CSS selectors.">CSS Selectors</a></li> <li><a href="/css/css3/animations/animatable_properties/" title="Properties that support CSS animations.">CSS Animatable Properties</a></li> <li><a href="/css/color/" title="Full CSS color reference, includes color picker, charts, generators, and more.">CSS Color</a></li> <li><a href="/css/css_color_codes.cfm" title="">CSS Color Codes</a></li> <li><a href="/css/tutorial/" title="">CSS Tutorial</a></li> <li><a href="/css/flexbox/tutorial/" title="">Flexbox Tutorial</a></li> <li><a href="/css/grid/tutorial/" title="">Grid Tutorial</a></li> <li><a href="/css/css_media_types.cfm" title="Use CSS to apply a separate style depending on the media type that is displaying your web page">CSS Media Types</a></li> <li><a href="/css/css_media_features.cfm" title="Use CSS to apply a separate style depending on the media features available in the output device">CSS Media Features</a></li> <li><a href="/bootstrap/tutorial/" title="Bootstrap is a free and open-source framework for creating websites and web applications.">Bootstrap Tutorial</a></li> <li><a href="/sass/tutorial/" title="Sass is a CSS preprocessor to help create maintainable style sheets.">Sass Tutorial</a></li> </ul> </li> </ul> </nav> <div class="ad ad-left"> <!-- GAM 71161633/QCKIT_quackit/article_vrec_2 --> <div data-fuse="23059511712"></div> </div> </div> <div class="ads"> <div class="ad ad-right"> <!-- GAM 71161633/QCKIT_quackit/article_vrec_1 --> <div data-fuse="23059883626"></div> </div> </div> </div> <div class="searchbox-bottom"> <form action="/search/" id="cse-search-box-bottom" class="site-search"> <div> <input type="hidden" name="cx" value="partner-pub-6331358926293806:npmuvy-i8kk"> <input type="hidden" name="cof" value="FORID:10"> <input type="hidden" name="ie" value="ISO-8859-1"> <input type="text" name="q" size="30" class="site-search-input"> <button type="submit" name="sa" class="site-search-button"><i class="fa fa-search"></i></button> </div> </form> <script src="//cse.google.com/cse/brand?form=cse-search-box-bottom&amp;lang=en"></script> </div> <footer> <p class="about"><a href="/"><i class="fa fa-home"></i> Home</a> | <a href="/about.cfm" rel="nofollow">About</a> | <a href="/contact.cfm" rel="nofollow">Contact</a> | <a href="/terms_of_use.cfm" rel="nofollow">Terms&nbsp;of&nbsp;Use</a> | <a href="/privacy_policy.cfm" rel="nofollow">Privacy&nbsp;Policy</a></p> <p>&#169; Copyright 2000 - 2025 Quackit.com &nbsp;</p> </footer> <script src="/common/js/spectrum/spectrum.js"></script> <script src="/common/js/lightbox2-master/dist/js/lightbox.min.js" charset="utf-8"></script> <script> $(document).ready(function(){ $( "#site-nav-toggler" ).click(function() { $( "#site-nav" ).toggle( "slow" ); }); }); </script> <script> $(function(){var a=window.location.href;$(".sidebar nav a").each(function(){a==this.href&&$(this).closest("li").addClass("selected")})}); </script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10