Home CSS Properties list-style-image CSS list-style-image Property Definition
Definition and Usage The list-style-image property sets an image (including gradients) as the marker for list items. It applies to elements with display: list-item (such as li).
The default is none, so list-style-type draws the marker. If an image fails to load, that type is the fallback. Prefer the list-style shorthand when you also set type or position.
Baseline widely available. Not deprecated. url(), none, and common gradients are safe. Marker size follows the image; oversized files can look uneven next to text.
Syntax
CSS Syntax list-style-image: <image> | none | initial | inherit ;
Examples: list-style-image: url("flower.png"); · list-style-image: none; · list-style-image: linear-gradient(red, blue);
Values
Property Values Value Description Try it url()Image file used as the marker Try iturl() + typeImage with list-style-type fallback Try it<gradient>CSS gradient used as the marker Try itnoneNo image; use list-style-type Try itinitialResets to none Try itinheritTakes the parent’s image value Try it
Approach
How to Use list-style-image Set the image on the list; items inherit the marker.
Select a ul or ol (markers need list items). Set list-style-image to url("...") or a gradient. Also set list-style-type so a marker remains if the image fails. Use a small, simple image so markers stay aligned with the text. Piece Required? Role <image>To show a custom marker url(), gradient, or other image valuenoneDefault Falls back to list-style-type Type fallback Recommended Shows if the image cannot load
Try it
Live Preview Only list-style-image changes on the sample list. Type stays square as a fallback.
Code
CSS Examples Each snippet focuses on list-style-image. Use Try It Yourself for a live editor.
1. url() 2. Gradient 3. none Example 1 — Image Marker Replace the default bullet with a small image.
<style>
ul {
list-style-type: square;
list-style-image: url("/images/flower.png");
}
</style>
<ul>
<li>Apollo</li>
<li>Hubble</li>
</ul> How It Works Target the list. The property on ul is inherited by each li.Set the image. url("/images/flower.png") becomes the marker.Keep a type. square is the fallback if the file cannot load.Prefer small art. Tiny icons keep the list tidy next to the text.Example 2 — Gradient Marker Use a CSS gradient as a valid image marker.
<style>
ul {
list-style-image: linear-gradient(135deg, #2563eb, #dc2626);
}
</style>
<ul>
<li>Apollo</li>
<li>Hubble</li>
</ul> How It Works Image values. Gradients count as <image>, so they are valid here.No file needed. Useful for demos without hosting a marker asset.Looks like a chip. Browsers paint a small gradient square as the marker.Still inherited. Nested items get the same gradient unless overridden.Example 3 — Reset to Type Turn off the image so the type marker shows again.
<style>
ul {
list-style-type: disc;
list-style-image: none;
}
</style>
<ul>
<li>Apollo</li>
<li>Hubble</li>
</ul> How It Works Default path. none means “no custom image.”Type takes over. disc (or your chosen type) draws the marker.Useful override. Nested lists can reset a parent image this way.Shorthand tip. list-style: none clears type, position, and image together. Edge Cases & Pitfalls Image markers are easy to misuse with size or missing fallbacks.
fallback Always set a type If the image 404s, list-style-type is what users see. Pair image and type on purpose.
size Large images look awkward Markers use the image’s intrinsic size. Prefer small SVGs or icons so lines stay readable.
shorthand list-style can reset the imageA later list-style: square sets image back to none. Set image in the same shorthand or after it.
a11y Markers are decorative Do not put meaning only in the marker image. Keep the list text clear on its own.
display Needs list items Markers apply to list items. A plain div needs display: list-item to show them.
Compatibility
Browser Support list-style-image is a browser CSS property for list markers. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
list-style-image url(), none, and common gradients are widely supported. Marker sizing can differ slightly by engine.
Google Chrome All versions
Full support
Mozilla Firefox All versions
Full support
Apple Safari All versions
Full support
Microsoft Edge All versions
Full support
Opera All versions
Full support
Samsung Internet All versions
Full support
Internet Explorer All versions
Full support list-style-image Widely supported
Bottom line: Safe for everyday custom markers. Prefer small images and a type fallback. It is not a runtime API.
Remember
Key Takeaways Role: sets an image (or gradient) as the list marker.
Default: none — then list-style-type draws the marker.
Fallback: always set a type in case the image fails.
Shorthand: list-style can reset image to none.
One line: list-style-image swaps the bullet for an image or gradient — keep a type fallback.
Frequently Asked Questions What does the CSS list-style-image property do? It sets an image (or other <image> value, such as a gradient) used as the list item marker instead of the default bullet or number.
What is the default value of list-style-image? The default is none. No custom image is used, so the marker from list-style-type shows.
What happens if the marker image fails to load? The browser falls back to list-style-type (for example disc or square). Keep a sensible type when you use an image.
Can I use a CSS gradient as the marker? Yes. Gradients are valid <image> values, so linear-gradient() and similar functions work as list-style-image.
Is list-style-image inherited? Yes. Set it on ul or ol and list items inherit it. Nested lists may still get user-agent type resets; the image still inherits unless overridden.
Which browsers support list-style-image? It is Baseline and widely available. It is a browser CSS property, not a Node.js or other runtime feature.
About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
8 people found this page helpful
Helpful Share Copy link Suggestion