The list-style-type
property in CSS is used to control the appearance of bullets or markers in HTML lists. Whether you’re working with unordered lists (<ul>
) or ordered lists (<ol>
), this property allows you to define how list items are markedโgiving you precise control over your list styling.
In this post, weโll explore what list-style-type
does, how to use it, and which values are commonly available.
๐ What Is list-style-type
?
The list-style-type
property sets the marker style for a list item element. It applies to:
<ul>
โ unordered lists<ol>
โ ordered lists<li>
โ individual list items
Syntax:
selector {
list-style-type: value;
}
๐ Common Values for list-style-type
๐น Unordered Lists (<ul>
)
These use simple shapes like bullets:
Value | Description |
---|---|
disc | Solid circle (default) |
circle | Hollow circle |
square | Solid square |
none | No marker |
Example:
ul {
list-style-type: square;
}
๐ธ Ordered Lists (<ol>
)
These use numbers, letters, or Roman numerals:
Value | Description |
---|---|
decimal | 1, 2, 3, … (default) |
decimal-leading-zero | 01, 02, 03, … |
lower-alpha | a, b, c, … |
upper-alpha | A, B, C, … |
lower-roman | i, ii, iii, … |
upper-roman | I, II, III, … |
Example:
ol {
list-style-type: upper-roman;
}
๐ซ Removing List Markers
To remove bullets or numbers from a list:
ul {
list-style-type: none;
padding-left: 0; /* optional: removes indentation */
}
This is common in nav menus and custom list styles where you want full design control.
โ
Where to Apply list-style-type
You can apply it directly to:
<ul>
or<ol>
(entire list)<li>
(individual list items, for granular control)
li.special {
list-style-type: square;
}
๐งฉ Related Properties
list-style
: Shorthand forlist-style-type
,list-style-position
, andlist-style-image
.list-style-position
: Controls whether the marker is inside or outside the content box.list-style-image
: Replaces the bullet with a custom image.
๐ Final Thoughts
The list-style-type
property gives you flexibility to style lists exactly how you wantโfrom traditional bullets to custom numbering schemes or no markers at all. Mastering this property allows you to build cleaner menus, readable documentation, or stylish interfaces without relying on extra HTML or JavaScript.