Created
March 4, 2014 22:26
-
-
Save nicksheffield/9357093 to your computer and use it in GitHub Desktop.
Sprite button in css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .sprite{ | |
| background-image: url(button_sprite.png); | |
| background-repeat: no-repeat; | |
| width: 198px; /* width of one button */ | |
| height: 54px; /* height of one button */ | |
| margin: 2em 0; | |
| /* optional, makes the background slide */ | |
| -webkit-transition: background-position 0.1s ease-out; | |
| transition: background-position 0.1s ease-out; | |
| } | |
| .sprite:hover{ | |
| background-position: 0 -54px; | |
| } | |
| .sprite:active{ | |
| background-position:0 -108px; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment