Skip to content

Instantly share code, notes, and snippets.

@acki
Created March 31, 2015 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acki/877a69ec37cbc2769bcd to your computer and use it in GitHub Desktop.
Save acki/877a69ec37cbc2769bcd to your computer and use it in GitHub Desktop.
CSS black and white filter for images (IE6+)
img.desaturate{
-webkit-filter: grayscale(1); -webkit-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment