-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gradient Border.html
59 lines (53 loc) · 1.61 KB
/
Gradient Border.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CodePen - Gradient Border</title>
<style>
@import url("https://fonts.googleapis.com/css?family=Lato:300");
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #222;
}
.gradient-border {
--border-width: 3px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 300px;
height: 200px;
font-family: Lato, sans-serif;
font-size: 2.5rem;
text-transform: uppercase;
color: white;
background: #222;
border-radius: var(--border-width);
}
.gradient-border::after {
position: absolute;
content: "";
top: calc(-1 * var(--border-width));
left: calc(-1 * var(--border-width));
z-index: -1;
width: calc(100% + var(--border-width) * 2);
height: calc(100% + var(--border-width) * 2);
background: linear-gradient(60deg, #5f86f2, #a65ff2, #f25fd0, #f25f61, #f2cb5f, #abf25f, #5ff281, #5ff2f0);
background-size: 300% 300%;
background-position: 0 50%;
border-radius: calc(2 * var(--border-width));
animation: moveGradient 4s alternate infinite;
}
@keyframes moveGradient {
50% {
background-position: 100% 50%;
}
}
</style>
</head>
<body translate="no">
<div class="gradient-border">css<br>is<br>awesome</div>
</body>
</html>