How to change Color Picture to Black and White Picture by css3
This article introduces the relevant knowledge of "how css3 changes color pictures into black and white pictures". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In css3, you can use the filter property to change a color picture to a black-and-white picture by setting the value of this property to "grayscale (%)", in the syntax format "img {filter:grayscale (100%)}".
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
In css3, you can use the filter property to change a color picture to a black and white picture, just set the value of this property to "grayscale (%)".
The filter attribute defines the element (usually the
Visual effects (for example, blur, saturation, grayscale).
Grayscale (%): converts an image to a grayscale image. Value defines the scale of the conversion. A value of 100% completely converts to a grayscale image, while a value of 0% does not change the image. A value between 0% and 100% is a linear multiplier of the effect. If not set, the default value is 0.
Example:
.img {filter:grayscale}
Effect picture:
This is the end of the content of "how to change color pictures into black and white pictures by css3". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!