Skip to content

Instantly share code, notes, and snippets.

@brubrant
Forked from gedankennebel/gist:a4c9367cda02ad7e826f
Last active June 30, 2016 20:26
Show Gist options
  • Save brubrant/144a77ac01a0e69d9cbbe6e383a13b2b to your computer and use it in GitHub Desktop.
Save brubrant/144a77ac01a0e69d9cbbe6e383a13b2b to your computer and use it in GitHub Desktop.
CSS grayscale filter (go from grayscale to full color on hover) #css #sethneilson
img:hover {
-webkit-filter: grayscale(0%);
-webkit-transition: .5s ease-in-out;
-moz-filter: grayscale(0%);
-moz-transition: .5s ease-in-out;
-o-filter: grayscale(0%);
-o-transition: .5s ease-in-out;
filter: grayscale(0%);
}
img {
-webkit-filter: grayscale(100%);
-webkit-transition: .5s ease-in-out;
-moz-filter: grayscale(100%);
-moz-transition: .5s ease-in-out;
-o-filter: grayscale(100%);
-o-transition: .5s ease-in-out;
filter: grayscale(100%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment