+ 15

How to do animation using hover tag in CSS?

19th May 2020, 12:18 PM
YASH SHAH
YASH SHAH - avatar
3 odpowiedzi
+ 9
Please give me 1 upvote
19th May 2020, 4:12 PM
YASH SHAH
YASH SHAH - avatar
+ 5
<style> #move{ width:200px; background-color:blue; height:200px; top:10px; left:10px; position:absolute; } #move:hover{ animation:moving_square 2s infinite; } @keyframes moving_square{ 50%{ top:100px; } 100%{ left:100px; } } </style> </head> <body> <div id="move"></div>
19th May 2020, 12:45 PM
Abhay
Abhay - avatar