支持 Firefox、Chrome 等主流浏览器的全站变灰 CSS 代码
1 <style> 2 html{ 3 -webkit-filter: grayscale(100%); 4 -moz-filter: grayscale(100%); 5 -ms-filter: grayscale(100%); 6 -o-filter: grayscale(100%); 7 filter: grayscale(100%); 8 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"); 9 filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); 10 } 11 </style>
html5