Article Introduction: Sichuan Yaan Lushan occurred 7 magnitude earthquake, many of the homepage has become a gray mourning. The following author has sorted out several CSS code to make the webpage gray, for you to webmaster Reference! |
April 21 National Day of Mourning Web page dimmed CSS code http://www.webjx.com/css/divcss-23270.html
Sichuan Yaan Lushan occurred 7 magnitude earthquake, many of the homepage has become a gray mourning. The following author has sorted out several CSS code to make the webpage gray, for you to webmaster Reference!
Method 1: Support IE
Html{filter:progid:dximagetransform.microsoft.basicimage (grayscale=1);}
Description: This method supports IE and does not support non IE kernel browsers such as Firefox and Chrome
Method 2: Support IE
Body {Filter:gray} Description: This method supports IE, does not support Firefox and Chrome and other non IE kernel browsers.
Tip: Although this method has the smallest amount of code, but the effect is not good, and the Web page also compare card
Method 3: Support IE and chrome at the same time
HTML {
Overflow-y:scroll;
Filter:progid:DXImageTransform.Microsoft.BasicImage (grayscale=1);
-webkit-filter:grayscale (100%);
}
Description: This method supports browsers such as IE, Safari, and Chrome, but does not support Firefox browsers.
Method 4: Use the Grayscale.js plug-in
Use the Grayscale.js plug-in. This plug-in is analog IE's filter:progid side, the official website address in:
http://james.padolsey.com/javascript/grayscaling-in-non-ie-browsers/
How to use:
Description: Support browsers such as IE, Safari, Chrome, Opera and Firefox.
Question: This in IE also quite occupy the resources.
Recommendation: Use Method 3, although not support more browsers, but stable, fast, and resource consumption is small.