Home >Web Front-end >CSS Tutorial >Use CSS to make web pages black and white

Use CSS to make web pages black and white

php中世界最好的语言
php中世界最好的语言Original
2018-03-21 17:10:204464browse

This time I will bring you how to use CSS to make a web page black and white, and use CSS to make a web page black and white. What are the precautions? The following is a practical case, let's take a look.

The method is as follows:

This CSS code can change the web page to black and white. Add the code to the top of the CSS to achieve plain decoration.

html{
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
}
If there is no

HTML tag in your page, remember to add it. You can add the following HTML5 tag, or change the html of the above CSS tag to body or other.

<!DOCTYPE html>
<html>
</html>
There are some websites where the color of FLASH

animation cannot be controlled by CSS filters. It can be done in the FLASH code of <object …> and Insert:

<param value="false" name="menu"/>
<param value="opaque" name="wmode"/>
If some pages with Flash still display color, or the Flash FLV player changes when the browser scroll bar is dragged up and down (such as Jian Wang 3, Jian Xia World official website divert page) , change Flash to JS output (SWFObject in this example):

<script type="text/javascript" src="/js/swf.js"></script>
<p id="video_content"></p>
<script type="text/javascript">
<!--
var video_player_so = new SWFObject("video-542.swf", "sotester", "439", "246", "7");
video_player_so.addParam("wmode", "opaque");
video_player_so.addParam("allowfullscreen","true");
video_player_so.addParam("allowscriptaccess","always");
video_player_so.write("video_content");
//-->
</script>

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to php Other related articles on the Chinese website!

Recommended reading:

Detailed explanation of the use of CSS Selector

Detailed explanation of the special features of CSS margin skills

The above is the detailed content of Use CSS to make web pages 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