Home  >  Article  >  Web Front-end  >  A tribute that cannot be forgotten: Tutorial on changing the background of a web page to black and white

A tribute that cannot be forgotten: Tutorial on changing the background of a web page to black and white

青灯夜游
青灯夜游Original
2020-04-04 11:28:224452browse

Unforgettable condolences: In order to express condolences for the people who died in this major epidemic, php Chinese website changed the entire website to black and white to express condolences to the deceased.

The code is shared with everyone below:

Black and white CSS code

html{
  -webkit-filter: grayscale(100%);
 -moz-filter: grayscale(100%);
 -ms-filter: grayscale(100%);
 -o-filter: grayscale(100%);
 filter: grayscale(100%);
 filter: gray; 
}

It’s very simple, just add a piece of code.

Usage Tutorial:

This code can change the web page to black and white. Add the code to the top of the CSS to make the entire site plain.

A tribute that cannot be forgotten: Tutorial on changing the background of a web page to black and white

The black and white rendering after adding:

A tribute that cannot be forgotten: Tutorial on changing the background of a web page to black and white

The above is the detailed content of A tribute that cannot be forgotten: Tutorial on changing the background of a web page to black and white. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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