On the national day of mourning, many website interfaces have become black and white to commemorate those who died in the earthquake. For ordinary webmasters, nothing can be done for disasters, but they can also turn their websites into black and white to remember those who have died.
If you use the traditional method to change the website to black or white, you need to change the page file and change the image. If your website uses CSS, it will be very simple. You only need to add a line of code at the beginning of the CSS file to conform to the w3 standard webpage, this Code uses the CSS Filter to filter out the color part of the webpage.
Html {filter: progid: DXImageTransform. Microsoft. BasicImage (grayscale = 1) ;}( no line feed)
After the code is added, refresh the page again and you will find that the page has become black and white.
Other methods:
Method 1:
On your website page
<Head> Add the following code:
<Style type = "text/css">
Body {filter: gray}
</Style>
Method 2:
On your website page
<Head> Add the following code:
<Style>
Html {filter: progid: DXImageTransform. Microsoft. BasicImage (grayscale = 1 );}
</Style>
Method 3:
Find your website's CSS file and put the following code in the header of the website's css file (this is the method used by CERNET)
Body {
Filter: gray;
}
Method 4:
Find your website's CSS file and put the following code in the website's css file header.
Html {filter: progid: DXImageTransform. Microsoft. BasicImage (grayscale = 1 );}
Method 5:
Find your CSS file and modify the css code file. In the following files
Form, div, span, img, ul, ol, li ,{
Add filter: Gray;
Some website FLASH Animation colors cannot be controlled by CSS filters. You can <object…> And </object>:
Copy content to clipboard
Code:
<Param = "false" name = "menu"/>
<Param = "opaque" name = "wmode"/>
The above method is used to collect and sort the original article links from the network.