list-style-type

Term side of the Card.
Topic: Lists
Unit title: list-style-type
Categories: Property
Explanation side of the Card

Explanation: The property that specifies the type of marker used for list items, such as 'disc', 'circle', 'square', 'decimal', 'none' and more. It determines the appearance of the list markers, allowing customization of the look for ordered and unordered lists.

Browser compatibility:
  • The chrome browser supports this feature starting from version 1.
  • The edge browser supports this feature starting from version 12.
  • The firefox browser supports this feature starting from version 1.
  • The safari browser supports this feature starting from version 1.
Availability: 

Example

Wrongcss
ul {
  list-style: none;
}
li::before {
  content: "– ";
}
Rightcss
ul {
  list-style-type: "– ";
}

A string value replaces the bullet while keeping the native marker box, its alignment and list semantics.

Common mistakes

  • Rebuilding bullets with ::before and losing alignment of wrapped lines.

Key points

  • Custom bullet text uses a string value or ::marker, not ::before content on top of a hidden marker.
  • Ordered lists keep <ol> in HTML, while the type only changes how numbers look.
  • Custom systems are defined with @counter-style and used by name.

Interview questions

How do I use letters instead of numbers in a list?

Use 'lower-alpha' or 'upper-alpha' on the list, or Roman numerals with 'lower-roman' or 'upper-roman'.

Can I use an emoji as a list bullet?

Yes. Use a string value like list-style-type: "✅ " or set content on ::marker.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy