The CSS list properties allow you to:
In HTML, there are two types of lists:
With CSS, lists can be styled further, and images can be used as the list item marker.
The type of list item marker is specified with the
Some of the values are for unordered lists, and some for ordered lists.
To specify an image as the list item marker, use the
The example above does not display equally in all browsers. IE and Opera will display the image-marker a little bit higher than Firefox, Chrome, and Safari.
If you want the image-marker to be placed equally in all browsers, a crossbrowser solution is explained below.
The following example displays the image-marker equally in all browsers:
list-style property is a shorthand property. It is used to set all the
list properties in one declaration:
When using the shorthand property, the order of the property values are:
list-style-type(if a list-style-image is specified, the value of this property will be displayed if the image for some reason cannot be displayed)
list-style-position(specifies whether the list-item markers should appear inside or outside the content flow)
list-style-image(specifies an image as the list item marker)
If one of the property values above are missing, the default value for the missing property will be inserted, if any.
All the different list-item markers for lists
This example demonstrates all the different list-item markers in CSS.
|list-style||Sets all the properties for a list in one declaration|
|list-style-image||Specifies an image as the list-item marker|
|list-style-position||Specifies if the list-item markers should appear inside or outside the content flow|
|list-style-type||Specifies the type of list-item marker|