I have one doubt do we need to give negative values for CSS Sprite images, i am using a vertical spirte image. Can i give postive values also in this if yes will it work on responsive versions too.
background:url(images/test.png) 0 232px/ 100% auto;
Yes, you can put negative values to
background-position: x y
. Question is... Why you want to place Sprite in not visible area?Why background-position is negative?
When you specify
background-position: 0 0
it means that sprite image top-left corner is in top-left corner of element. Now that you want to show more inner view of image you have to move your sprite in desired direction according to element. Sobackground-position-x
mean you are moving sprite top-left corner to the right from where your element top-left corner is.Visualization: