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" "">
<HTML xmlns = "">

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">
Filter: Gray

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.