分享一個使全站變灰的CSS特效代碼

來源:互聯網
上載者:User
分享一個使全站變灰的CSS特效代碼,小程式,特來分享如下

相容主流瀏覽器的全站變灰CSS代碼:

  1. html {     -webkit-filter: grayscale(100%);    -moz-filter: grayscale(100%);    -ms-filter: grayscale(100%);    -o-filter: grayscale(100%);    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>#grayscalerayscale");    filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); zoom: 1;}

另外還有 js 變灰代碼可用:
grayscale(document.body);
grayscale.js 請自行搜尋。

html {    -webkit-filter: grayscale(100%);    filter: grayscale(100%);    filter: url(desaturate.svg#grayscale);    filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.