CSS provides properties to control the appearance of HTML lists, including:
Defines the type of bullet or numbering for a list
ul {
list-style-type: square; /* circle, disc, square */
}
ol {
list-style-type: upper-roman; /* decimal, lower-alpha, upper-latin etc. */
}
Use an image instead of a bullet.
ul {
list-style-image: url('bullet.png');
}
Defines where the bullet appears.
ul {
list-style-position: outside;
}
Bullet is placed inside, and text aligns with it
ul {
list-style-position: inside;
}
You can combine all three in one:
ul {
list-style: square inside url('icon.png');
}
Order doesn’t matter.
Useful for navigation menus:
ul {
list-style: none;
padding: 0;
margin: 0;
}
<ul class="custom-list">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
.custom-list {
list-style-type: square;
list-style-position: inside;
color: #444;
font-size: 18px;
}
CSS List Properties:
| Property | Description |
|---|---|
| list-style-type | Bullet or numbering style |
| list-style-image | Custom image bullet |
| list-style-position | Bullet inside/outside |
| list-style | Shorthand for all list properties |