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

CSS使图片变灰

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 14:32:511522browse

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

〈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

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
Previous article:CSS Sprite 雪碧图制作Next article:css3飞机起飞进度条