滤镜中-黑白

结构:

<div class="pic">
   <img src="meinv.jpg">
</div>

样式:

*{ padding:0; margin:0;}
html,body{ height:100%;}
.pic
{ 
display: flex;  
align-items: center;  
justify-content: center;
height:100%;
 }
.pic img{
 display:block;
 margin:0 auto;
-webkit-filter: grayscale(100%); /* webkit */ 
-moz-filter: grayscale(100%); /*firefox*/ 
-ms-filter: grayscale(100%); /*ie9*/ 
-o-filter: grayscale(100%); /*opera*/ 
filter: grayscale(100%); 
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); 
filter:gray; /*ie9- */ 

} 

运行:

 

posted @ 2016-07-22 13:36  大饼怪  阅读(191)  评论(0编辑  收藏  举报