Last active
June 30, 2022 22:01
-
-
Save otakupahp/7186e529b95953e2cc4d26aeb5c1f870 to your computer and use it in GitHub Desktop.
Simple CSS Loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="loader"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Codepen at https://codepen.io/otakupahp/pen/KKowxPZ