Home > Web Front-end > CSS Tutorial > Use CSS to make your website black and white

Use CSS to make your website black and white

php中世界最好的语言
Release: 2018-03-21 17:09:13
Original
1835 people have browsed it

This time I will bring you how to use CSS to make the website black and white, and use CSS to make the website 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);
}
Copy after login
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>
Copy after login
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"/>
Copy after login
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>
Copy after login

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 CSS Selector use

CSS3 filter (filter ) attribute detailed explanation

#Detailed explanation of the special usage skills of CSS margin

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