0513-80919976 在线客服 返回顶部
企业动态 技术分享 行业动态

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

2016-10-13分享

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:

返回     
最新动态
Copyright © 2005 ntgmwl.COM 南通光芒网络科技有限公司 版权所有 备案号:苏ICP备16017392号-1   苏公网安备 32068202000133号 
【南通|崇川|港闸|通州|如皋|海安|启东|海门|如东|盐城|东台|泰州|泰兴|姜堰|镇江|常州|张家港|苏州|无锡|南京】
网站建设推广|微信公众平台开发|微信小程序开发|APP开发|微信朋友圈广告投放|百度关键词优化排名|淘宝/阿里巴巴店铺推广
分享: