< Cascading Style Sheets

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

References

Extending CSS Spriting

CSS Sprites are Stupid

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.