list-style-image
Example
li {
list-style-image: url("check-large.png");
}li {
list-style: none;
padding-inline-start: 1.5em;
background: url("check.svg") no-repeat 0 0.2em / 1em;
}list-style-image shows the image at its natural size, so a background gives control over size and position.
Common mistakes
- The bullet image is too big and there is no way to scale it.
Key points
- Bullet images that need a set size use
::marker,::beforeor a background, sincelist-style-imagecannot be resized. - A
list-style-typefallback is kept for when the image fails to load. - Decorative bullet images carry no meaning that must be read aloud.
Interview questions
Can I change the size of list-style-image?
No. The image is shown at its natural size. Use an SVG drawn at the right size, or a background or ::before image instead.
Can I use an SVG for list-style-image?
Yes. Any image URL works, and an SVG with set width and height gives a crisp, predictable bullet.