<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Awesome Button</title>
</head>
<body>
<a href="#"><span>Button</span></a> <a href="#"><span>Button</span></a> <a href="#"><span>Button</span></a> <a href="#"><span>Button</span></a>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body {
display: flex;
flex-direction: column;
gap: 20px;
min-height: 100vh;
justify-content: center;
align-items: center;
background: #000;
}
a {
position: relative;
width: 160px;
height: 50px;
line-height: 48px;
background: #000;
text-transform: uppercase;
font-size: 25px;
text-align: center;
letter-spacing: 0.1em;
text-decoration: none;
transition: 0.5s;
-webkit-box-reflect: below 1px linear-gradient(transparent, #0004);
}
a span {
position: absolute;
display: block;
top: 1px;
left: 1px;
right: 1px;
bottom: 1px;
text-align: center;
background: #0c0c0c;
color: rgba(255, 255, 255, 0.2);
transition: 0.5s;
}
a:hover span {
color: rgba(255, 255, 255, 1);
}
a span::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 50%;
background: rgba(255, 255, 255, 0.1);
z-index: 10;
}
a::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
45deg,
#c0392b,
#f39c12,
#f1c40f,
#2ecc71,
#3498db,
#2980b9,
#9b59b6,
#8e44ad,
#c0392b,
#f39c12,
#f1c40f,
#2ecc71,
#3498db,
#2980b9,
#9b59b6,
#8e44ad
);
background-size: 400%;
opacity: 0;
transition: 2.5s;
animation: eff 20s linear infinite;
}
a:hover::before,
a:hover::after {
opacity: 1;
}
a::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
45deg,
#c0392b,
#f39c12,
#f1c40f,
#2ecc71,
#3498db,
#2980b9,
#9b59b6,
#8e44ad,
#c0392b,
#f39c12,
#f1c40f,
#2ecc71,
#3498db,
#2980b9,
#9b59b6,
#8e44ad
);
background-size: 400%;
opacity: 0;
filter: blur(20px);
transition: 0.5s;
animation: eff 20s ease infinite;
}
@keyframes eff {
0% {
background-position: 0 0;
}
50% {
background-position: 400% 0;
}
100% {
background-position: 0 0;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.