In CSS, the list-style-type property controls the marker (bullet or numbering style) used for lists. You can:
<ul>).<ol>).Lists are perfect for navigation menus, feature lists, steps in a process, and more.
list-style-type defines the marker style (disc, circle, square, decimal, roman, etc.).<ul>) use bullets; ordered lists (<ol>) use numbers/letters.list-style-type: none; is common for custom menus and navigation bars.Basic syntax of the list-style-type property:
// General syntax for list-style-type
selector {
list-style-type: value;
}
Common values for unordered lists:
disc – default filled circle.circle – hollow circle.square – filled square.none – removes the bullet.Common values for ordered lists:
decimal – 1, 2, 3, ...lower-alpha – a, b, c, ...upper-alpha – A, B, C, ...lower-roman – i, ii, iii, ...upper-roman – I, II, III, ...This example uses a square bullet for an unordered list:
// Use square bullets for unordered list
ul.custom-bullets {
list-style-type: square;
}
<ul class="custom-bullets">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
This example uses standard decimal numbers for an ordered list:
// Use decimal numbers for ordered list
ol.steps {
list-style-type: decimal;
}
<ol class="steps">
<li>Plan the layout</li>
<li>Write the HTML</li>
<li>Add CSS styling</li>
</ol>
Often used for navigation menus or custom icons:
// Remove bullets to create a clean nav list
ul.nav-list {
list-style-type: none;
padding: 0;
margin: 0;
}
<ul class="nav-list">
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
In a browser, changing list-style-type in CSS will instantly change how these markers look, without changing the HTML structure.
Here are two main list types you will use in web pages:
| Type | Example Values | Use Case |
|---|---|---|
Unordered List (<ul>) |
disc, circle, square |
Features list, bullet points, navigation items. |
Ordered List (<ol>) |
decimal, lower-alpha, upper-roman |
Steps in a process, rankings, instructions. |
list-style-type to match the tone of your content (formal lists can use roman numerals).list-style-type: none; and use custom icons or flexbox layout.padding and margin on ul/ol for clean alignment.list-style-type with different values like circle, square, and upper-roman.list-style-type: none; and style the items as a horizontal navigation bar.