CSS list-style-image Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

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.

CSS Syntax

syntax.css
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);

Property Values

ValueDescriptionTry it
url()Image file used as the markerTry it
url() + typeImage with list-style-type fallbackTry it
<gradient>CSS gradient used as the markerTry it
noneNo image; use list-style-typeTry it
initialResets to noneTry it
inheritTakes the parent’s image valueTry it

How to Use list-style-image

Set the image on the list; items inherit the marker.

  1. Select a ul or ol (markers need list items).
  2. Set list-style-image to url("...") or a gradient.
  3. Also set list-style-type so a marker remains if the image fails.
  4. Use a small, simple image so markers stay aligned with the text.
PieceRequired?Role
<image>To show a custom markerurl(), gradient, or other image value
noneDefaultFalls back to list-style-type
Type fallbackRecommendedShows if the image cannot load

Live Preview

Only list-style-image changes on the sample list. Type stays square as a fallback.

none shows the square type fallback. Gradients are valid image markers.

Sample list
  • Apollo
  • Hubble
  • Cassini

list-style-image: url(/images/flower.png)

CSS Examples

Each snippet focuses on list-style-image. Use Try It Yourself for a live editor.

Example 1 — Image Marker

Replace the default bullet with a small image.

CSS
<style>
  ul {
    list-style-type: square;
    list-style-image: url("/images/flower.png");
  }
</style>

<ul>
  <li>Apollo</li>
  <li>Hubble</li>
</ul>
Try It Yourself

How It Works

  1. Target the list. The property on ul is inherited by each li.
  2. Set the image. url("/images/flower.png") becomes the marker.
  3. Keep a type. square is the fallback if the file cannot load.
  4. 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.

CSS
<style>
  ul {
    list-style-image: linear-gradient(135deg, #2563eb, #dc2626);
  }
</style>

<ul>
  <li>Apollo</li>
  <li>Hubble</li>
</ul>
Try It Yourself

How It Works

  1. Image values. Gradients count as <image>, so they are valid here.
  2. No file needed. Useful for demos without hosting a marker asset.
  3. Looks like a chip. Browsers paint a small gradient square as the marker.
  4. 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.

CSS
<style>
  ul {
    list-style-type: disc;
    list-style-image: none;
  }
</style>

<ul>
  <li>Apollo</li>
  <li>Hubble</li>
</ul>
Try It Yourself

How It Works

  1. Default path. none means “no custom image.”
  2. Type takes over. disc (or your chosen type) draws the marker.
  3. Useful override. Nested lists can reset a parent image this way.
  4. 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 image

A 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.

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.

100% Common values
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.

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

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.
The default is none. No custom image is used, so the marker from list-style-type shows.
The browser falls back to list-style-type (for example disc or square). Keep a sensible type when you use an image.
Yes. Gradients are valid <image> values, so linear-gradient() and similar functions work as list-style-image.
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.
It is Baseline and widely available. It is a browser CSS property, not a Node.js or other runtime feature.

Next: list-style-position

Learn where the marker sits relative to the text.

list-style-position tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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