Teach you how to turn color Web pages black and white

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.