img {
filter: brightness(0) invert(1);
}
Example 2: HOW TO ANIMATE AN IMAGE USING - HTML & CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="1.css">
</head>
<body>
<div class="img-box">
<img src="contact.png" alt="contact.png">
</div>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-content: center;
width: 100%;
min-height: 100vh;
background: #111;
animation: animate 1s linear infinite;
}
@keyframes animate {
0% {
filter: hue-rotate(0deg);
}
100% {
filter: hue-rotate(360deg);
}
}
.img-box {
width: 500px;
height: 450px;
}
.img-box img {
width: 100%;
height: 100%;
}