CSS3 grayscale滤镜图片变黑白

CSS3 grayscale滤镜图片变黑白实例

CSS代码

.gray { 
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: grayscale(100%);
    filter: gray;
    opacity: 1
}

HTML代码

<img src="http://image.zhangxinxu.com/image/study/s/s256/mm1.jpg" />
<img src="http://image.zhangxinxu.com/image/study/s/s256/mm1.jpg" class="gray" />


上一篇 Layer For Mobile 移动端弹出层
下一篇 跨浏览器Html页面及图像灰度(grayscale)
目录
文章列表
1 设计模式(17)中介者模式
设计模式(17)中介者模式
2
Android NDK基础19:C++_构造函数属性初始化_new(delete)_静态成员_this指针
Android NDK基础19:C++_构造函数属性初始化_new(delete)_静态成员_this指针
3
Spring Boot 中的 RestTemplate不好用?试试 Retrofit!
Spring Boot 中的 RestTemplate不好用?试试 Retrofit!
4
Vue或React项目代码相同运行出错采坑记录
Vue或React项目代码相同运行出错采坑记录
5
matplotlib之plt.subplot
matplotlib之plt.subplot
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。