Style listStyleImage property

Definition and Usage

listStyleImage Sets or returns an image as the marker for list items.

See also:

CSS Tutorial:CSS-lista

CSS Reference Manual:list-style-image property

HTML DOM Reference Manual:listStyle property

Example

Example 1

Sets the image as the marker for list items in the list:

document.getElementById("myList").style.listStyleImage = "url('sqorange.gif')";

Try it yourself

Example 2

Returns the list-style-image property value:

alert(document.getElementById("myList").style.listStyleImage);

Try it yourself

Syntax

Returns the listStyleImage property:

object.style.listStyleImage

Sets the listStyleImage property:

object.style.listStyleImage = "none|url|initial|inherit"

Attribute value

Value Description
none Does not display any image. Default.
url Specifies the path of the image.
initial Sets this property to its default value. See also initial.
inherit Inherits this property from its parent element. See also inherit.

Technical details

Default value: none
Return value: A string that represents the path to the image.
CSS version: CSS1

Webbläsarstöd

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Stöd Stöd Stöd Stöd Stöd