Skip to: content, navigation

by Tommy Olsson and Paul O’Brien

list-style (CSS property)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Buggy Full Full Full
Spec
Inherited Initial Version
Yes CSS1
list-style: { list-style-type list-style-position list-style-image | inherit } ;

Example

This style rule uses inheritance to set the list marker for items within the element with ID "legal" to be uppercase Latin letters that appear inside the list items’ principal block boxes:

#legal {
 list-style: upper-latin inside;
}

Try it yourself!View all demos

Description

This shorthand property sets all three list style properties simultaneously. Note that an omitted property value will be set to that property’s initial value.

Value

Refer to the individual properties for information on allowed and initial values.

Compatibility

IE5.5Buggy
6.0Buggy
7.0Buggy
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

Internet Explorer for Windows versions up to and including 7 will only recognize a list image URI if it’s immediately followed by whitespace, or the end of the declaration.

Internet Explorer for Windows versions up to and including 7 don’t support the value inherit.

User-contributed notes

ID:
#2
Date:
Wed, 19 Mar 2008 05:08:06 GMT
Contributed by:
mattymcg
Status:
This note has not yet been confirmed for accuracy and relevance.

I'd expect to see the individual properties listed as Related Reading...

ID:
#1
Date:
Tue, 04 Mar 2008 14:06:40 GMT
Contributed by:
Paul O'B
Status:
This note has not yet been confirmed for accuracy and relevance.

There seems to be to be a shorthand bug in IE6 and 7 where it won't hide the list-image with list-style:none but only with list-style-image:none;

A simple test confirms this:

ul{
list-style-type: square;
list-style-image: url(bullet.gif);
padding: 1em;
margin: 0;
list-style:none;
/*list-style-image:none; IE would also need this*/
}

<ul>
<li>testing</li>
</ul>

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters