结构:
<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- */ }
运行:
时间: 2024-11-01 13:39:49