A summary of various methods of CSS Web page change Gray

Source: Internet
Author: User

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;
}

Related Article

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.