云南网站建设
手机:18908755675 QQ:6567252 微信:18908755675 座机:0875-2880080 返回顶部
企业动态 技术分享 行业动态

CSS怎么使网页全部变成灰色

2016-08-15 来源:云南银穗科技www.sss8.cn作者:银穗科技www.sss8.cn

Desaturating a color image couldn’t be simpler with CSS3. We’ll apply the filter as a class, as you’d typically desire several images to be affected by the code at the same time:

img.desaturate { filter: grayscale(100%); }

Naturally, all current browsers implement CSS3 filters via vendor prefixes, so our first job is to insert that code, writing in CSS that does not yet exist in order to future-proof our work:

img.desaturate { filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}

Applying the class to the image is easy:

      今天云南网络公司银穗科技就分享到这里,云南网站建设昆明网站建设云南网站开发昆明网站开发云南网站制作昆明网站制作相关的问题都可以和小编交流,小编QQ:6567252
在线咨询
公安备案: 滇网备53010302000718号

云南网站建设 云南网站建设 云南网站建设 法律顾问:杨飞剑(北京盈科(昆明)律师事务所)
ICP备案号:滇ICP备18007757号 Copyright © 2018-2020 www.sss8.cn 银穗科技 版权所有