Skip to content

Instantly share code, notes, and snippets.

@Lammerink
Created October 21, 2012 00:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lammerink/3925301 to your computer and use it in GitHub Desktop.
Save Lammerink/3925301 to your computer and use it in GitHub Desktop.
CSS : Basic Link Roll Over CSS Sprite
Basic Link Rollover as CSS Sprite
a {
display: block;
background: url(sprite.png) no-repeat;
height: 30px;
width: 250px;
}
a:hover {
background-position: 0 -30px;
}
The set height and width ensure only a portion of the sprite.png graphic is shown. The rollover shifts the position of the background image, revealing a different area of the graphic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment