+ 15
How to do animation using hover tag in CSS?
3 Answers
+ 9
Please give me 1 upvote
+ 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>