html{filter: grayscale(100%);}马上清明节了,下面来教大家一行代码让网站变灰的方法!
直接上代码:
html{filter: grayscale(100%);}
如果想兼容好一点的话,就用下面的代码:
html { -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); }