CSS list-style
The CSS list-style property is a shorthand property for specifying styles for list items.
The list-style property is shorthand for the list-style-type, list-style-position and list-style-image properties.
Syntax
These values are explained below.
Possible Values
- 'list-style-type'
-
Provides the value for the
list-style-typeproperty.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
@counter-styleat-rule, then refer to that style inlist-styleby simply adding that counter style's name as the first value.You can also provide a string as the value (the string becomes the marker) or use the
symbols()function as a quick way to add a custom marker style.See
list-style-typefor more detail and examples. - 'list-style-position'
-
Provides the value for the
list-style-positionproperty. This property allows you to control the position of the::markerpseudo-element in the list item. - 'list-style-image'
-
Provides the value for the
list-style-imageproperty. This property is used to specify an image to be used as a list marker's default contents.
In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:
initial- Represents the value specified as the property's initial value.
inherit- Represents the computed value of the property on the element's parent.
unset- This value acts as either
inheritorinitial, 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.
General Information
- Initial Value
- Depends on the value of the individual properties. Their initial values are as follows:
list-style-typedisclist-style-positionoutsidelist-style-imagenone
- Applies To
- List item elements
- Inherited?
- Yes
- Media
- Visual
Example Code
Official Specifications
- CSS Counter Styles Level 3 (W3C Candidate Recommendation, 11 June 2015)
- CSS Lists and Counters Module Level 3 (W3C Working Draft)
- CSS Level 2.1 (W3C Recommendation 07 June 2011)
- CSS Level 1 (W3C Recommendation 17 Dec 1996)