Gaurav
Posted on March 4, 2021
Hello everyone. In this quick tutorial, let's learn how to create a loading spinner using pure CSS in 3 easy steps!
Step 1 - HTML
Create the HTML structure we need (which is just 1 line)
<div class="spinner"></div>
Step 2 - Add basic styles.
.spinner{
width: 64px;
height: 64px;
border: 8px solid;
border-color: #3d5af1 transparent #3d5af1 transparent;
border-radius: 50%;
animation: spin 1.2s linear infinite;
}
Step 3 - Add the spin animation
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
That's it! we have created the loading spinner. Here is the final result.
Thank u๐
๐ ๐ช ๐
๐ฉ
Gaurav
Posted on March 4, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.