Directly in the CSS below plus
Start by adding a phrase to your CSS:
The code is as follows |
Copy Code |
* { Filter:gray } . Clear { Clear:both } Body { Background-repeat:repeat-x } |
But the above can only be used in IE browser and flash is not valid
If you need to make the site dimmed, add a layer of filters on the Web page.
The code is as follows |
Copy Code |
HTML {filter:progid:DXImageTransform.Microsoft.BasicImage (grayscale=1);} Or: HTML {Filter:gray} |
Sometimes added after may not be effective, because the site does not use the latest Web page standard protocol.
You need to add in the page:
The code is as follows |
Copy Code |
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 2 |
The color of the website Flash animation cannot be controlled by the CSS filter, need to add between <object...> and </object> of the Flash code:
The code is as follows |
Copy Code |
<param value= "false" name= "menu"/> <param value= "opaque" name= "wmode"/> |
All-in-line gray CSS code compatible with mainstream browsers:
code is as follows |
copy code |
HTML { -webkit-filter:grayscale (100%); -moz-filter:grayscale (100%); -ms-filter:grayscale (100%); -o-filter:grayscale (100%); filter:url ("Data:image/svg+xml;utf8,<svg xmlns= ' http:/ /www.w3.org/2000/svg ' ><filter id= ' grayscale ' ><fecolormatrix type= ' matrix ' values= ' 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0 '/></filter></svg> #grayscalerayscale ' ); filter:progid:DXImageTransform.Microsoft.BasicImage (grayscale=1); zoom:1; } |