CSS之纪念日主题网页变灰的两种方法

简洁版:

body{
    filter: grayscale(100%);
    zoom:1;
}

健全版:

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);
}

注: 均不兼容IE

文章由官网发布,如若转载,请注明出处:https://www.dpaoz.com/197
1.2k

发表评论

嘿,我来帮您!