In this tutorial, you will learn how to create an animated striped border with CSS. Watch the video below for a detailed tutorial.
<body>
<div class="border">
<h1>Winterwind Inc.</h1>
</div>
</body>
body {
background-color: #2e3537;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.border {
padding: 30px 0;
background-color: #e1f4fa;
width: 517px;
text-align: center;
position: relative;
}
.border:before {
content: '';
position: absolute;
top: -10px;
left: -10px;
right: -10px;
bottom: -10px;
z-index: -1;
background: repeating-linear-gradient(-45deg, #0b6878 0, #0b6878 10px, #e1f4fa 10px, #e1f4fa 20px, #38c1d9 20px, #38c1d9 30px, #e1f4fa 30px, #e1f4fa 40px);
animation: animate 15s linear infinite;
}
@keyframes animate {
from {
background-position: 0;
}
to {
background-position: 500px;
}
}
.border h1 {
margin: 0;
font-size: 3rem;
font-family: 'Arial', sans-serif;
text-transform: uppercase;
color: #2b859e;
}