Skip to content

Instantly share code, notes, and snippets.

@otakupahp
Last active June 30, 2022 22:01
Show Gist options
  • Save otakupahp/7186e529b95953e2cc4d26aeb5c1f870 to your computer and use it in GitHub Desktop.
Save otakupahp/7186e529b95953e2cc4d26aeb5c1f870 to your computer and use it in GitHub Desktop.
Simple CSS Loader
.container {
height: 300px;
width: 300px;
margin: 0 auto;
display: flex;
justify-content: center;
align-content: center;
}
.loader {
position: relative;
}
.loader:before {
content: " ";
border-left: 2px solid gray;
border-top: 2px solid gray;
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 1s linear infinite;
position: absolute;
left: 8px;
bottom: 6px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
<div class="container">
<div class="loader"></div>
</div>
@otakupahp
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment