The list-style property

list-style sets how markers look in ul and ol lists: the marker type, its position and an image. It is a shorthand for list-style-type, list-style-position and list-style-image.

Syntax

list-style: <type> <position> <image>;
list-style: disc | circle | square | decimal | upper-roman | none;
list-style: inside | outside;
list-style: square inside;
Initial value
disc outside none
Inherited
yes
Applies to
list items (display: list-item, such as li); convenient to set on ul or ol, since the property is inherited

Values

ValueWhat it does
noneno marker — what menus and navigation use
disca filled circle — the default for ul
circlea hollow circle
squarea square
decimalnumbers 1, 2, 3 — the default for ol
upper-romanRoman numerals I, II, III
insidethe marker inside the item box, with the text wrapping around it
outsidethe marker to the left, outside the text — the default

Example

.menu {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 16px;
}
.square { list-style: square inside; }
.roman { list-style: upper-roman; }
li::marker { color: #0284c7; }
<ul class="menu">
  <li>Home</li>
  <li>Courses</li>
  <li>Contact</li>
</ul>
<ul class="square">
  <li>square, inside</li>
  <li>square, inside</li>
</ul>
<ol class="roman">
  <li>Roman numerals</li>
  <li>Roman numerals</li>
  <li>Roman numerals</li>
</ol>

Result

▶ Open in HTML Editor

Good to know

  • list-style: none removes the markers but not the indent: browsers give ul and ol a padding-left (about 40px). For a menu add padding: 0.
  • The ::marker pseudo-element changes the marker's color and size, for example li::marker { color: … }.
  • In Safari with VoiceOver a list with list-style: none may stop being announced as a list. If that matters to readers, add role="list" to the ul.

Sources and specification

See also