Use CSS variable(animation)
This is CSS sheet(animation)
/* css animation */
.img-fin{
max-width: 170px;
height: 200px;
display: block;
margin: 0 auto;
margin-top: 100px;
margin-bottom: 100px;
border: 4px solid black;
border-radius: 60%;
}
.img-fin:hover{
animation-name: img-ani;
animation-duration: 3s;
animation-fill-mode: forwards;
}
@keyframes img-ani {
0%{
max-width: 170px;
border-color: chartreuse;
}
50%{
max-width: 240px;
border-color: rgb(27, 3, 243);
}
100%{
max-width: 300px;
height: 300px;
border-color: fuchsia;
}
}
.img-fin1{
max-width: 170px;
height: 200px;
display: block;
margin: 0 auto;
margin-top: 100px;
margin-bottom: 100px;
border: 4px solid black;
border-radius: 60%;
position: relative;
animation-name: img-an1;
animation-duration: 1s;
animation-iteration-count: infinite;
}
@keyframes img-an1 {
0%{
top: 0;
}
50%{
top: 100px;
border-color: red;
}
100%{
top: 0;
}
}
This is HTML sheet
<img src="dont.png" alt="fine" class="img-fin">
<img src="dont.png" alt="fine" class="img-fin1">
Comments
Post a Comment