Skip to content

Instantly share code, notes, and snippets.

@magemore
Created April 25, 2012 04:58
Show Gist options
  • Save magemore/2486556 to your computer and use it in GitHub Desktop.
Save magemore/2486556 to your computer and use it in GitHub Desktop.
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;
}
@magemore
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment