Skip to content

Instantly share code, notes, and snippets.

@ahmu83
Created May 2, 2021 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmu83/5e0accaf3c65f2b76bb7ec8448d1b465 to your computer and use it in GitHub Desktop.
Save ahmu83/5e0accaf3c65f2b76bb7ec8448d1b465 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Simple CSS Loading Icon</title>
</head>
<style type="text/css" media="screen">
body {
margin-top: 150px;
text-align: center;
}
.loading {
display: inline-flex;
width: 24px;
height: 24px;
background-color: white;
border: 2px solid black;
border-radius: 100%;
position: relative;
justify-content: flex-start;
align-items: flex-start;
}
.loading::before {
content: "";
position: absolute;
width: 5px;
height: 5px;
background-color: white;
border-radius: 100%;
}
.loading.animate {
animation-name: animateLoading;
animation-duration: 0.8s;
animation-iteration-count: infinite;
animation-direction: normal;
animation-timing-function: linear;
}
@keyframes animateLoading {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>
<body>
<div class="loading animate"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment