Last active
March 26, 2022 00:17
-
-
Save brysongilbert/6062276 to your computer and use it in GitHub Desktop.
CSS colour invert via SVG filter for Webkit, Firefox, and Internet Explorer 6-8.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* WebKit */ | |
-webkit-filter: invert(); | |
/* Firefox */ | |
filter: url("data:image/svg+xml;utf8,<svg height='0' xmlns='http://www.w3.org/2000/svg'><filter id='negative'><feColorMatrix values='-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0'/></filter></svg>#negative"); | |
/* IE 6-7 */ | |
filter: progid:DXImageTransform.Microsoft.BasicImage(invert=1); | |
/* IE 8 */ | |
-ms-filter: 'progid:DXImageTransform.Microsoft.BasicImage(invert=1)'; |
/* IE9-IE11 invert all colors, including images */
body:before { content:"";position:fixed;top:100%;left:100%;z-index:9999;width:1px;height:1px;outline:2999px solid invert; }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IE11 not working too