Pampour

Cross-browser CSS Grayscale snippet

Mar 6th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.60 KB | None | 0 0
  1. .grayscale {
  2.     filter: grayscale(100%); // General Grayscale support
  3.     -webkit-filter: grayscale(100%); //Webkit Browser Support
  4.     -moz-filter: grayscale(100%); // Mozilla Firefox Support
  5.     -ms-filter: grayscale(100%); // IE Support
  6.     -o-filter: grayscale(100%); // Opera Browser Support
  7.     filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><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>#grayscale"); /* Firefox 10+, Firefox on Android */
  8.     filter: gray; /* IE6-9 */
  9. }
Advertisement
Add Comment
Please, Sign In to add comment