Detailed explanation of the 4 codes that turn the website black, white and gray

Detailed explanation of the 4 codes that turn the website black, white and gray

The 2008.5.12 Wenchuan earthquake in Sichuan took away many lives, which is regrettable. In order to express deep condolences to our compatriots who died in the disaster, the State Council decided to designate May 19 to 21, 2008 as national days of mourning. During this period, many websites changed their style to "black, white and gray" to express their condolences to the compatriots who died. It is suggested that webmasters across the country take action to mourn the compatriots who died in the earthquake.

Related article: Change the website to black and white with one line of CSS code.
In order to make it easier for individual webmasters to express their condolences, we have summarized some practical CSS filter codes. With some minor adjustments, you can convert the website to a "black, white, and gray" style.

Method 1:

html {
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
}

The above code can change the web page to black, white and gray. Adding the code to the top of CSS can achieve plain decoration.

Method 2:

If your website does not use CSS files, you can insert them between the <head> and </head> of the HTML code of the web page/template:

<style type="text/css">
html{
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
}
</style>

Some webmasters' websites may not be able to take effect using this CSS because the website does not use the latest web page standard protocol. Replace the <html> at the top of the web page with the following code:
<!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">

Method 3:

The color of some website FLASH animations cannot be controlled by CSS filters. You can insert the following between <object …> and </object> in the FLASH code:

<param value="false" name="menu"/>
<param value=”opaque” name=”wmode”/>

Method 4:

The simplest code to turn the page into black, white and gray is between the head: (or the selector in the CSS file is html or body)

<style type="text/css">
html {
filter: gray;
}
</style>

We mourn the victims of the 2008 May 12 Wenchuan earthquake in Sichuan.

Method 5

<style>
html {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
_filter:none;
}
</style>

The above is a detailed explanation of the 4 codes that turn the website into black, white and gray. For more information about turning the website into gray, please pay attention to other related articles on 123WORDPRESS.COM!

<<:  Embed player in web page embed element autostart false invalid

>>:  MySQL Series II Multi-Instance Configuration

Recommend

Function overloading in TypeScript

Table of contents 1. Function signature 2. Functi...

How to solve the front-end cross-domain problem using Nginx proxy

Preface Nginx (pronounced "engine X") i...

Detailed explanation of MySQL slow log query

Slow log query function The main function of slow...

MySQL 8.0.11 compressed version installation tutorial

This article shares the installation tutorial of ...

How to install SVN server under Linux

1. Yum installation yum install subversion 2. Con...

Docker private warehouse harbor construction process

1. Preparation 1.1 harbor download harbor downloa...

Comparison of two implementation methods of Vue drop-down list

Two implementations of Vue drop-down list The fir...

How to use Docker to build enterprise-level custom images

Preface Before leaving get off work, the author r...

Google Translate Tool: Quickly implement multilingual websites

Google China has released a translation tool that ...

SystemC environment configuration method under Linux system

The following is the configuration method under c...

WeChat applet selects the image control

This article example shares the specific code for...

Example of how to change the line spacing of HTML table

When using HTML tables, we sometimes need to chan...

Sending emails in html is easy with Mailto

Recently, I added a click-to-send email function t...

js implements clock component based on canvas

Canvas has always been an indispensable tag eleme...

Interpretation of the module for load balancing using nginx

Table of contents Two modules for using nginx for...