tags:

views:

33

answers:

2

I have the following CSS

.ul{
    list-style-image:url(/images/bullet.png)
}

My bullet.png is 20 x 20px however it is displaying the text at the bottom of the image while I need to display my text in the middle of the image. Is there a way to assign margins and paddings that move only the text?

A: 

Not really. You can try removing the bullets, put padding on the LI and a background-image aligned left and center: background: url(images/bullet.png) no-repeat left center;.

ANeves
+2  A: 

Reset the paddings and margins.

Use background-image property and set a padding of the size of the image (and more if you want some space between your bullet and your text)

li
{
  margin: 0;
  padding: 0 20px 0 0;
  background-image:url(/images/bullet.png);
  background-repeat: no-repeat;
}
Boris Guéry
thanks a lot, its works quite nicely and across browsers. Its a pity that the 'list-style-image' tag has to be worked around and is essentially useless in this respect but as long as it looks good across browsers I guess it's ok.
William Calleja