National day of mourning, please turn the web page into black and white! Webpage black and white code!

Source: Internet
Author: User

Description: method 1 is to use the CSS Filter for Color Filtering, as long as the page displayed by calling this CSS will become black and white. This is convenient if you need full-site black/white.

Method 2: Add a style code before the head to make the full screen gray. The function is to modify a page file, for example, only the homepage is modified, only the homepage is black and white, and other pages are normal.

 

 

1If it is a static page and supports CSS, as long as it is a Web page that complies with the W3 standard, you can add a line of code at the beginning of the CSS file. This Code uses the CSS Filter, filter out the color part of the webpage.

CSS Filter color code:

HTML {filter: progid: DXImageTransform. Microsoft. basicimage (grayscale = 1 );}

Usage: This code changes the webpage to black and white, and adds the code to the top of CSS to achieve the black and white effect of the webpage.

Some websites may not be able to use this CSS because the website does not use the latest standard webpage protocol.

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">

Replace the header of the Web page with the above Code.

Some website Flash Animation colors cannot be controlled by CSS filters, and can be inserted between flash codes:

<Param value = "false" name = "menu"/>
<Param value = "Opaque" name = "wmode"/>

2The simplest code for turning pages into gray is to add

<Style type = "text/CSS">
HTML {
Filter: Gray
}
</Style>

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.