CSS Reference ยท Lists, Tables and Generated Content
The list-style property
Reference for the CSS list-style shorthand: set the marker type, position and image of lists in one declaration, with live examples and usage notes.
The list-style property is a shorthand for list-style-type, list-style-position and list-style-image. It controls the marker (bullet or number) in front of each list item. It is usually set on the <ul> or <ol>; the value is inherited by the items.
The most common use is list-style: none, which removes the markers so a list can become a menu or a row of cards.
ul.menu { list-style: none; padding: 0; } ol.steps { list-style: upper-roman inside; }
Try it
The list item backgrounds show where the content box starts: with inside the marker sits within the shaded box, with outside it hangs in the padding to the left.
Syntax
list-style: <type> || <position> || <image>; list-style: none; list-style: inherit;
| Initial value | disc outside none (the longhands' initial values) |
| Applies to | List items (elements with display: list-item) and, through inheritance, their parents |
| Inherited | Yes |
| Animatable | No |
| Computed value | As each longhand |
Values
| Value | Description |
|---|---|
<list-style-type> |
A marker keyword such as disc, decimal or lower-roman, a string, or a custom counter style name. See list-style-type. |
<list-style-position> |
inside or outside (default). See list-style-position. |
<list-style-image> |
A url() image or none. See list-style-image. |
none |
Counts as none for both type and image if neither is otherwise given. Removes the marker. |
The three parts can appear in any order and any can be omitted; an omitted part resets to its initial value.
Usage notes
- The shorthand resets.
list-style: squarealso sets position tooutsideand image tonone, discarding earlier values of those longhands in the same rule. - Removing bullets and accessibility. In some browsers, a list with
list-style: noneis no longer announced as a list by screen readers. If it is a real list, addrole="list"to the<ul>to keep it announced. - Padding still applies. Browsers give
<ul>and<ol>a default start padding. Reset it withpadding: 0(orpadding-inline-start: 0) when you remove markers. - Not just for
<li>. Any element withdisplay: list-itemgets a marker, and you can remove it with the same property. - Style the marker itself (color, size) with the
::markerpseudo-element.
Browser support
Supported in all browsers. Some marker types (for example certain non-Latin counter styles) vary in older browsers.