Home > Web Front-end > CSS Tutorial > 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

青灯夜游
Release: 2020-04-04 11:57:26
Original
4476 people have browsed it

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; 
}
Copy after login

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!

Related labels:
css
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