美文网首页
使用 css 滤镜转换图片颜色

使用 css 滤镜转换图片颜色

作者: 槑小姐_1419 | 来源:发表于2019-01-04 16:52 被阅读0次

【css学习】色调旋转滤镜实现按钮颜色设置

CSS filter:hue-rotate

css代码

   .img {
    width: 300px; height: 232px;
    background: url(img/piece-bird.png) no-repeat;
    background-size: contain;
    /* 动画 */
    animation: pulse 5s linear infinite;
}
@keyframes pulse {
    from {
        filter: hue-rotate(0);
    }
    to {
        filter: hue-rotate(360deg);
    }
}

html

<body>
  <div class="img"></div>
</body>
jpg图片
png图片
学习出处
https://www.zhangxinxu.com/wordpress/2018/11/css-filter-hue-rotate-button/

相关文章

网友评论

      本文标题:使用 css 滤镜转换图片颜色

      本文链接:https://www.haomeiwen.com/subject/emrqrqtx.html