Skip to content

Instantly share code, notes, and snippets.

@Ricardo-Diaz
Created October 25, 2012 23:07
Show Gist options
  • Save Ricardo-Diaz/3956028 to your computer and use it in GitHub Desktop.
Save Ricardo-Diaz/3956028 to your computer and use it in GitHub Desktop.
CSS: Link Rollover as Sprite
Basic Link Rollover as CSS Sprite
Save bandwidth and the hassle of creating a separate “hover” version of your button by using this sprite. It moves the background image of your button down when hovering over it, creating the hover effect.
a {
display: block;
background: url(sprite.png) no-repeat;
height: 30px;
width: 250px;
}
a:hover {
background-position: 0 -30px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment