List-style-image: url() property or background: url() to add list item background images?

Is there any difference between using the list-style-image property and using background: url() to use an image as a list item marker?

I’m used to using images as list item backgrounds in the following way:


ul{
margin: 0;
padding: 0;
}
ul li{
list-style-type: none;
margin: 0;
padding: 0;
background: url("../images/some-image.jpg");
}

Thanks

Its easier to use a background image because you have precise control over the positioning which you don’t get with the list-style:image.

The list-style-image is probably the semantic choice (although css doesn’t really impose semantics on the mark up) but developers rarely use a list image because its position varies so much between browsers and you have absolutely no control over where the image is placed.

It’s one of those CSS properties that is basically useless :smile:

I was messing around with it right now and I see the issue that you’re talking about.

Thanks

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.