首页 >web前端 >html教程 >CSS使图片变灰

CSS使图片变灰

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-01 14:32:511522浏览

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

〈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

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn