Style listStyle property

Definition and usage

listStyle Properties can be set or returned in a shorthand form, up to three separate list properties.

Through this property, you can set/return the following one or more (in any order):

See also:

CSS Tutorial:CSS List

CSS Reference Manual:list-style property

Instance

Example 1

Change the list style:

document.getElementById("myList").style.listStyle = "decimal inside";

Try it yourself

Example 2

Change the type and position of the list to "square inside":

document.getElementById("myList").style.listStyle = "square inside";

Try it yourself

Example 3

Return the list style:

document.getElementById("myList").style.listStyle;

Try it yourself

Syntax

Return the listStyle property:

object.style.listStyle

Set the listStyle property:

object.style.listStyle = "type position image|initial|inherit"

Property value

Value Description
type Define the type of the list item marker.
position Position the list item marker.
image Define the image used as the list item marker.
initial Set this property to its default value. See initial.
inherit Inherit this property from its parent element. See inherit.

Technical details

Default value: disc outside none
Return value: A string representing the list style.
CSS version: CSS1

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support