I'm developing a web page where I use a lot of CSS effects. between one of them I realized that I can not use filters in Firefox. Searching the internet I found some solutions that tell me to use SVG files. The problem is when I need to use 2 filters on the same element, for example reverse the color of an image and put shadow. In Chrome I can do it this way:
div img{
-webkit-filter: invert(100%) drop-shadow(0.2em 0.1em 0.3em #000);
}
When using 2 SVG in firefox, it buga, sometimes it shows an effect, sometimes it shows another effect, sometimes it does not show, as if it depended on which SVG was last loaded and overlapped the first one.
How to resolve this deadlock?
One of the class
I use to transform a black and white image
.grayscale {
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 3.5+ */
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
}