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

Detailed explanation of MySQL persistent statistics

1. The significance of persistent statistical inf...

ElementUI implements cascading selector

This article example shares the specific code of ...

Ubuntu 16.04 64-bit compatible with 32-bit programs in three steps

Step 1: Confirm the architecture of your system d...

Vue+openlayer5 method to get the coordinates of the current mouse slide

Preface: How to get the coordinates of the curren...

Introduction to nesting rules of html tags

There are many XHTML tags: div, ul, li, dl, dt, d...

HTML is the central foundation for the development of WEB standards

HTML-centric front-end development is almost what ...

What to do if you forget your mysql password

Forgot your MySQL password twice? At first I did ...

Example of integrating Kafka with Nginx

background nginx-kafka-module is a plug-in for ng...

MySQL Server IO 100% Analysis and Optimization Solution

Preface During the stress test, if the most direc...

Implementation of effective user groups and initial user groups in Linux

First check the /etc/group file: [root@localhost ...

React uses emotion to write CSS code

Table of contents Introduction: Installation of e...