Last Updated: September 11, 2020
· marcosors

CSS3 image filters

Today CSS3 image filters work only in Chrome, but it's fun to start playing with them. Here's a complete list:

.blur {-webkit-filter: blur(4px);}

.brightness {-webkit-filter: brightness(0.35);}

.contrast {-webkit-filter: contrast(140%);}

.grayscale {-webkit-filter: grayscale(100%);}

.huerotate {-webkit-filter: hue-rotate(180deg);}

.invert {-webkit-filter: invert(100%);}

.opacity {-webkit-filter: opacity(60%);}

.saturate {-webkit-filter: saturate(4);}

.sepia {-webkit-filter: sepia(100%);}

In case you want to get ready for the future you can target also the other browsers with these prefixes:

-moz-filter: filter-name;
-o-filter: filter-name;
-ms-filter: filter-name; 

Check out some examples here:

5 Responses
Add your response

Very nice! Thanks!

over 1 year ago ·

tnx it helped a lot;)

over 1 year ago ·

Thanks for the tips

over 1 year ago ·

Thanks, this helped me a lot!

over 1 year ago ·

What about filter drop-shadow? It's amazing when it's used on PNG images with some transparency or elements with ::before and ::after pseudo-elements.

over 1 year ago ·