灰度图片 css
aren't yet widely supported but they are indeed impressive and a modern need for web imagery. CSS filters allow you to modify the display of images in a variety of ways, one of those ways being displaying images as grayscale.
尚未得到广泛支持,但它们确实令人印象深刻,并且是对Web图像的现代需求。 CSS过滤器允许您以多种方式修改图像的显示,其中一种方式是将图像显示为灰度。
Doing so requires the most minimal of CSS:
这样做需要最少CSS:
img.bw { filter: grayscale(1);}
You can even animate an image to or from grayscale:
您甚至可以为图像设置灰度或从灰度设置动画:
img.bw { filter: grayscale(0);}img.bw.grey { filter: grayscale(1); transition-property: filter; transition-duration: 1s; }
allow much more than just grayscale adjustments, so if you haven't taken the time, please play around with my . Remember that if the user chooses to download the image, it is downloaded in its original colored displays, but for online display purposes, CSS filters do the trick!
不仅仅可以进行灰度调整,因此,如果您还没有花时间,请试用我的 。 请记住,如果用户选择下载图像,则会以其原始的彩色显示器下载该图像,但是出于在线显示目的,CSS过滤器可以解决问题!
翻译自:
灰度图片 css