Skip to content
Tutorials Center
My learning

Topics

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.

CSS
ul.menu {
  list-style: none;
  padding: 0;
}
ol.steps {
  list-style: upper-roman inside;
}

Try it

Shorthand in action

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

CSS
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: square also sets position to outside and image to none, discarding earlier values of those longhands in the same rule.
  • Removing bullets and accessibility. In some browsers, a list with list-style: none is no longer announced as a list by screen readers. If it is a real list, add role="list" to the <ul> to keep it announced.
  • Padding still applies. Browsers give <ul> and <ol> a default start padding. Reset it with padding: 0 (or padding-inline-start: 0) when you remove markers.
  • Not just for <li>. Any element with display: list-item gets a marker, and you can remove it with the same property.
  • Style the marker itself (color, size) with the ::marker pseudo-element.

Browser support

Supported in all browsers. Some marker types (for example certain non-Latin counter styles) vary in older browsers.