Open In App

CSS list-style-image Property

Last Updated : 27 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

CSS List-Style-Image Property is a handy tool that allows you to customize your list item markers with images. This property transforms your lists from ordinary to extraordinary, making your web pages more engaging and visually appealing.

Syntax:

list-style-image: none|url|initial|inherit;

Property Values:

none

This value specifies that no image is used as the marker. If this value is set, the marker defined in the list-style type is used instead. This is the default value. 

initial

This mode sets this property to its default value. 

url

In this value, the path to the image is used as a list-item marker. 

Methods to use List Style Image Property

1. Using CSS list style image property value as none:

Example: In this example, we are using list-style-image: none; property.

html
<!DOCTYPE html>
<html>
<head>
    <title>
        CSS list-style-image Property
    </title>
    <style>
        ul {
            list-style-image: none;
        }
    </style>
</head>

<body style="">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>

    <h2>
        CSS list-style-image Property
    </h2>

    <p>Sorting Algorithms</p>

    <ul>
        <li>Bubble Sort</li>
        <li>Selection Sort</li>
        <li>Merge Sort</li>
    </ul>
</body>
</html>

Output:

 liststyleimage

2. Using CSS list style image property value as url:

Example: In this example, we use list-style-image: url; property.

html
<!DOCTYPE html>
<html>
<head>
    <title>
        CSS list-style-image Property
    </title>
    <style>
        ul {
            list-style-image:
url("https://write.geeksforgeeks.org/wp-content/uploads/listitem-1.png");
        }
    </style>
</head>

<body style="">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>

    <h2>
        CSS list-style-image Property
    </h2>

    <p>Sorting Algorithms</p>

    <ul>
        <li>Bubble Sort</li>
        <li>Selection Sort</li>
        <li>Merge Sort</li>
    </ul>
</body>
</html>

Output:

 liststyleimage

Supported Browsers: The browser supported by list-style-image property are listed below:

  • Google Chrome 1.0 and above
  • Edge 12.0 and above
  • Internet Explorer 4.0 and above
  • Firefox 1.0 and above
  • Opera 7.0 and above
  • Apple Safari 1.0 and above


Next Article

Similar Reads