Use CSS to make the website black and white

不言
Release: 2018-06-21 17:54:42
Original
2882 people have browsed it

This article mainly introduces the use of CSS to make the website black and white. It has a certain reference value. Now I share it with you. Friends in need can refer to it.

The following is the CSS code of the whole site.

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

How to use: This code can change the webpage to black and white. Add the code to the top of CSS to achieve plain decoration.
If the website does not use CSS, you can insert between the HTML code and of the web page/template:

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

Some websites may not use this css because it does not take effect. The website does not use the latest web standard protocol

<!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

Please replace the at the top of the webpage with the above code.
The color of FLASH animations on some websites 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

The simplest code to turn the page into gray is to add

<style type="text/css"> 
html { 
FILTER: gray 
} 
</style>
Copy after login

above between the heads That’s the entire content of this article. I hope it will be helpful to everyone’s study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

Simulate the effect of box-shadow in css3 under IE

Beautification of div imitation checkbox form style and functions

Beautiful buttons made using css styles

The above is the detailed content of Use CSS to make the website black and white. For more information, please follow other related articles on the PHP Chinese website!

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