【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/
网友评论