修改所有图片的颜色为黑白 (100% 灰度)

2017-07-04 18:45:00
admin
原创
320
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title></title> 
<style>
img {
    width: 33%;
    height: auto;
    float: left; 
    max-width: 235px;
}

.blur {-webkit-filter: blur(4px);filter: blur(4px);}
.brightness {-webkit-filter: brightness(250%);filter: brightness(250%);}
.contrast {-webkit-filter: contrast(180%);filter: contrast(180%);}
.grayscale {-webkit-filter: grayscale(100%);filter: grayscale(100%);}
.huerotate {-webkit-filter: hue-rotate(180deg);filter: hue-rotate(180deg);}
.invert {-webkit-filter: invert(100%);filter: invert(100%);}
.opacity {-webkit-filter: opacity(50%);filter: opacity(50%);}
.saturate {-webkit-filter: saturate(7); filter: saturate(7);}
.sepia {-webkit-filter: sepia(100%);filter: sepia(100%);}
.shadow {-webkit-filter: drop-shadow(8px 8px 10px green);filter: drop-shadow(8px 8px 10px green);}
</style>
</head>
<body>

<p><strong>注意:</strong> Internet Explorer <span lang="no-bok">或 Safari 5.1 (及更早版本)</span> 不支持该属性。</p>

<img src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="blur" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="brightness" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="contrast" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="grayscale" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="huerotate" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="invert" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="opacity" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="saturate" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="sepia" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">
<img class="shadow" src="http://code.ybao.org/demo/img/pineapple.jpg" alt="Pineapple" width="300" height="300">

</body>
</html>
文章分类
联系我们
电话: 18902328227
Email: 2689701946@qq.com
QQ: 2689701946
微信: 18902328227
地址: 广州番禺区繁华路
  • 在线客服
  • 关注微信
  • 联系电话
    • 欢迎咨询
    • 欢迎加入QQ群 303257430
  • 公众号:源宝网络
    • 联系电话及微信号 18902328227