Cascading Style Sheets/Sprites

Use background-position:0 -## where ## is equal to the y-coordinate of the first pixel of the desired area to reposition sprites

Use the background-position property to change the hover state of links with background images using CSS sprites

Use background-image instead of the background shorthand when using ID selectors to avoid inadvertently overriding class-based background-position changes for CSS sprites

Use the clip property on image tags to do foreground spriting

Make sure class selectors aren't inadvertently overridden by default values of ID selectors, especially background-position changes for sprites, by dividing the properties of ID selectors using longhand notation

ReferencesEdit

Extending CSS Spriting

CSS Sprites are Stupid

Last modified on 4 September 2011, at 21:28