Two Methods of Website Grey

web front end twelve thousand three hundred and seventy-five 13 years ago (2011-02-22)


Whenever a major disaster or memorial event occurs in the country, in order to remember the compatriots who died in the disaster, the major websites have turned their pages into gray to show their condolences; Tencent, Sina, Yahoo and other portal websites have also become gray. Here are two ways to gray websites:

Method 1: Use the fastest method to gray the website (only IE is supported)

Add the following code to the CSS file referenced on the home page:
*{filter:gray; color:gray;}

Method 2: Add the following code to the CSS file:
 html { filter:gray;}
 html{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}
<style type="text/css">
html,body,p,div,form{ filter:gray;color:gray; }
</style>

In comparison, method 2 is superior to method 1, which is applicable to position: relative; Property, just put it on the first line of the CSS file.