Open In App

CSS list-style-image Property

CSS List-Style-Image Property, 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 list-style-type is used instead. This is 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.

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

<!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:

Article Tags :