<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body,html{
position:reletive;
}
div
{
position:absolute;
top:50%;
left:50%;
margin-left:-50px;
margin-top:-50px;
width:100px;
height:100px;
background:red;
border:8px double black;
transition:all 2s;
}
div:hover
{
background:yellow;
transform: scale(1.15) rotate(-360deg);
animation:myfirst infinite 4s;
}
@keyframes myfirst
{
from {border:8px double black;}
to {border:8px double red;}
}
</style>
</head>
<body>
<div class="myfirst"></div>
</body>
</html>