Reputation: 65
Is there a css-way to grayscaling a div with a properly percentage? I can do this in non-IE browsers with webkit support:
-webkit-filter: grayscale(0.7); //e.g. 70%
But in IE I can only use a boolean function like this:
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); //with '1'
Can I find out a way (possibly a not-svg way), I can grayscaling an image with a percentage with?
Upvotes: 4
Views: 5661
Reputation: 11502
@A.K's suggestion looks good, although I couldn't immediately see how to do partial grey-scale...
For a CSS-only solution - you can achieve a similar effect by making whatever you want to grey-scale partially transparent and putting a background colour behind it, like this: http://jsfiddle.net/R23LG/
Obviously you'd want to play around with the transparency settings etc. to get it how you want it.
Upvotes: 1
Reputation: 9467
Check this link desaturate
Browser Compatibility:
Internet Explorer 5.5+, Opera 9.5+, Firefox 2+, WebKit Nightly
Upvotes: 2