Home > Web Front-end > CSS Tutorial > Detailed explanation of 4 types of codes that change the website to black and white

Detailed explanation of 4 types of codes that change the website to black and white

巴扎黑
Release: 2017-06-09 14:16:04
Original
2834 people have browsed it

The 2008.5.12 Wenchuan earthquake in Sichuan took away many lives, which is regrettable. In order to express its deep condolences for the victims, the State Council decided May 19 to 21, 2008 as the National Day of Mourning. During this period, many websites changed their styles to "black, white, and gray" to express condolences for the victims. It is recommended that webmasters across the country take action to mourn the compatriots who died in the earthquake
The 2008.5.12 Wenchuan earthquake in Sichuan took away many lives, which is regrettable. In order to express its deep condolences to the compatriots who died in the earthquake, the State Council decided on May 2008 March 19th to 21st is a national day of mourning. During this period, many websites changed their styles to "black, white, and gray" to express condolences for the victims. It is recommended that webmasters across the country take action to mourn the compatriots who died in the earthquake.
 Related articles: One line of CSS code to make the website black and white.
In order to facilitate individual webmasters to express their condolences, we now summarize the practical CSS filter codes and make slight adjustments to convert the website into a "black, white, and gray" style.
Method 1:

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

The above code can change the web page to black and white and gray network. Add the code to the top of CSS to achieve plain decoration.
Method 2:
If the website does not use CSS files, you can insert between the HTML code and of the web page/template:

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

Some webmasters’ websites may not be able to use this css because the website does not use the latest web page standard protocol. Replace the at the top of the webpage 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”>
Copy after login

Method 3:
There are some websites where the color of FLASH animation cannot be controlled by CSS filters. , you can insert between and in FLASH code:

<param value=”false” name=”menu”/>
 <param value=”opaque” name=”wmode”/>
Copy after login

Method 4:
The simplest way to change the page The code for 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>
Copy after login

The above is the detailed content of Detailed explanation of 4 types of codes that change the website to black and white. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template