April 20 after the Yaan earthquake in Sichuan, the major websites in China have turned color websites into black and white, in order to express their silence to the people who died in the earthquake. Here's a simple way to make your color Web page black and white.
This time we will use a ready-made website as a case to teach you how to make a Web page black and white in a short time. Preparation Tools:
Google Chrome to prepare pages:
A complete homepage of the website, colorful.
Operation steps:
Google browser to open the "Baidu Encyclopedia" home, and then click the right mouse button, pop-up small window appears
Click "Review Element" and the Code debug area will appear below the browser.
We find the <body> section in the code, and then click on it, and we'll see a hazy piece above the code area, indicating that this code will affect the entire page.
Let's find the lower-right corner of the code area, which is the lower-right corner of the browser, locate the body's CSS code area, and then double-click the left mouse button, and you'll find that it takes another line.
We enter in a new line
-webkit-filter:grayscale (100%);
This code, meaning to let the page appear black and white, when the input is finished, I will find that the Web page magically became the effect we expected, it is black and white.
You can try to close the upper right corner of the code area of the fork button, you will find that Baidu Encyclopedia homepage, this time has become black and white. Of course, this is only the result of our local testing and is not directly reflected on the site.
Presumably most readers already know how to do it. We only need to add a piece of code to the body tag in the CSS style of the site.
Body{-webkit-filter:grayscale (100%);}
Yes, just add a paragraph to make your Web page black and white. Although only a small piece of code, if you have your own website, you also want to add a small section in the common for the Sichuan Yaan earthquake lost compatriots.