0

I'm overlooking something obvious in using my sprites. I have an example at JSFiddle. It is not displaying the sprite in the span and when I look at the element in Chrome, it is reporting an actual background position of 0px, 50%. The css is 0px, -31px.

Suggestions

photo_tom
  • 7,292
  • 14
  • 68
  • 116

3 Answers3

1

SPANS are not block elements, and cannot take on a width or height CSS property. Use a DIV or add display:block to your definition for this element.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
  • Thanks for oversight. I've updated the fiddle at http://jsfiddle.net/photo_tom/HJUg6/4/, However, my original problem still remains. In chrome, when I looked at the Computed Style, it is reporting the background position as 0px, 50%; – photo_tom Aug 27 '12 at 21:29
1

You have to make the SPAN display as block and lose the comma between your background position settings as there should simply be a space:

http://jsfiddle.net/HJUg6/2/

Billy Moat
  • 20,792
  • 7
  • 45
  • 37
0

Use display:block on the div and it works. ( I don't know if that's the image that you should see.. )

Alex Ionescu
  • 390
  • 3
  • 13