Jump to content

List Style - Image and Numbering?


jdanielp

Recommended Posts

Just wondering if anyone knows of a straightforward way in which to use CSS to include both an image and a number indicating the order before each element in a basic HTML list?It would seem that setting a 'list-style-image' simply over-rides any 'list-style-type' that may have been defined, but ideally I would like to display both, preferably so that each list item is preceeded by a common image followed by a number indicating its position.Thanks in advance if anyone is able to help!

Link to comment
Share on other sites

Actually there is a way!Create your list normaly with numbers. With css simply add the image as a background for each <li>. Place the background image on the left.

Link to comment
Share on other sites

Actually there is a way!Create your list normaly with numbers. With css simply add the image as a background for each <li>. Place the background image on the left.

Are you sure this works, If i add the background image to the ul then i have to add repeat-y which doesn't match up the pic and textIf i wrote it as li then the image covers the text.
Link to comment
Share on other sites

I tried it for the li element and it kind of works, but puts the image between the normal list numbering and the list text, rather than before the numbering as I had been hoping for. I can't seem to fix it by means of altering the background image positioning either...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...