list-style-type
Sets the type of list item marker: bullets, numbers, letters, or a custom symbol.
- Initial value
disc- Inherited
- Yes
- Animatable
- no
- Applies to
- list items (display: list-item)
- JavaScript
element.style.listStyleType = "square"
Example
#.checklist {
list-style-type: "β
";
}
.nav-list {
list-style-type: none;
padding: 0;
}<ul style="list-style-type: 'β
'; margin: 0;">
<li>Finish the Flexbox module</li>
<li>Do the summary exercise</li>
</ul>Definition and usage
#The list-style-type property changes the markers before the items of <ul> and <ol> lists. You can choose shapes (disc, circle, square), numbering (decimal, lower-alpha, upper-roman), and many numbering systems of different languages.
You can also provide your own string, for example "β " or "β ", which replaces the bullet. The none value removes markers, which is common in navigation menus.
The property is inherited and works on elements with display: list-item, which by default means <li>.
Syntax
#list-style-type: disc | circle | square | decimal | lower-alpha | upper-roman | none | "<string>" | β¦;Values
#Values in practice
#disc
.demo { list-style-type: disc; }square
.demo { list-style-type: square; }decimal
.demo { list-style-type: decimal; }upper-roman
.demo { list-style-type: upper-roman; }"β "
.demo { list-style-type: "β "; }none
.demo { list-style-type: none; }Browser support
#Widely available
Works in all modern browsers, phones included. You can use it without worry.
- Chrome
- Edge
- Firefox
- Safari
Good practices
#- In Safari, lists without markers (
none) may stop being announced as lists by screen readers. In navigation, addrole="list"to the<ul>. - You can change the colour and size of the marker itself with the
::markerpseudo-element.
Related entries
#Practise it in lessons
#Spotted a mistake or missing an example? Write to us.