One line of code turns web pages gray

One line of code turns web pages gray

<style type="text/css">
	html, img {
      
      /* 灰度滤镜 */
		filter: grayscale(100%);
		-webkit-filter: grayscale(100%);
		-moz-filter: grayscale(100%);
		-ms-filter: grayscale(100%);
		-o-filter: grayscale(100%);
		filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
		-webkit-filter: grayscale(1);
		}
</style>

CSS3 filter (filter) property
Filter function
Note: Filters usually use percentages (such as: 75%), and of course decimals can also be used to express (such as: 0.75).

grayscale(%)
converts the image to a grayscale image. The value defines the scale of the conversion. A value of 100% will completely convert to a grayscale image, and a value of 0% will not change the image. Values ​​between 0% and 100% are linear multipliers of the effect. If not set, the value defaults to 0;

-webkit-filter: grayscale(100%) : This style is exclusive to browsers that use the webkit kernel . Browsers with the webkit kernel include Google Chrome, Safari, Sogou High-speed Browser, etc.

-moz represents firefox browser private property

-ms stands for ie browser private property (360 browser is ie kernel)

-webkit represents safari, chrome private properties

-o stands for opera private attribute

Guess you like

Origin blog.csdn.net/qq_38689263/article/details/128136809