CSS list-style-image Property

CSS list-style-image property is used to set an image as list-items marker.

By default, the list-items marker is a bullet(•). But, we can replace it with any custom image we want. See the example below:

Example:

ul{
  list-style-image: url('images/thumb.png');
}

CSS Syntax

The list-style-image property has the following syntax:

list-style-image: none|url(source)|initial|inherit;

Property Values

The list-style-image property accepts the following values:

noneNo image is used as list items marker. This is the default value.
url(source)Sets the specified image as the list-items marker. The location of the image is provided using the inbuilt url() function.
initialSets the list-style-image property to its default value(none).
inheritInherits the list-style-image property from the parent element.

General Info

Default Valuenone
InheritedYes
JavaScript Usageelement.style.listStyleImage = “url(‘images/thumb.png’)”

Author

  • Manoj Kumar

    Hi, My name is Manoj Kumar. I am a full-stack developer with a passion for creating robust and efficient web applications. I have hands-on experience with a diverse set of technologies, including but not limited to HTML, CSS, JavaScript, TypeScript, Angular, Node.js, Express, React, and MongoDB.

    View all posts

Leave a Comment