<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
}
html, body {
height: 100%;
overflow: hidden;
}
body{
background: #191919;
display: flex;
align-items: center;
justify-content: center;
}
#button{
background-image: linear-gradient(90deg,#00C0FF,#FFCF00,#FC4F4F);
display: inline-block;
padding: 3px;
border-radius: 7px;
text-decoration: none;
animation:randommove 10s linear infinite;
}
#button:hover{
animation:randombackground 10s linear infinite;
}
#button span{
display: inline-block;
background: #191919;
color: white;
padding: 30px 60px;
border-radius: 7px;
font-size: 30px;
font-weight: 800;
text-transform: uppercase;
}
@keyframes randommove{
from{background-position: 0 0;}
to{background-position: 1000px 0;}
}
@keyframes randombackground{
0%{top:0px; left:0px; background:red;}
25%{top:0px; left:100px; background:blue;}
50%{top:100px; left:100px; background:yellow;}
75%{top:100px; left:0px; background:green;}
100%{top:0px; left:0px; background:red;}
</style>
</head>
<body>
<a href="#" id="button">
<span>Button</span>
</a>
</body>
</html>
