Home > Web Front-end > HTML Tutorial > CSS使图片变灰

CSS使图片变灰

WBOY
Release: 2016-06-01 14:32:51
Original
1516 people have browsed it

为了悼念,各大网站都纷纷将自己的站点颜色调灰,就连图片也一样,到底如何实现的呢,请看下面的代码。

〈img src="http://hovertree.com/hvtimg/201512/f748s0ko.jpg" style="filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)" onmouseover="this.style.filter='progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)'" onmouseout="this.style.filter='progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)'">

变灰:style= "filter:progid:DXImageTransform.Microsoft.BasicImage(grayScale=1); "

  如果想让整个网站的图片变灰,在样式表中加入

img{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}

按纽变灰
INPUT { border:1px solid #999;  filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}

 

推荐:http://www.cnblogs.com/roucheng/p/texiao.html

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