Skip to content

Instantly share code, notes, and snippets.

@remarkablemark
Last active March 7, 2026 01:42
Show Gist options
  • Select an option

  • Save remarkablemark/76f4e7fb1e1c9414aa0e7ad9a454b8b4 to your computer and use it in GitHub Desktop.

Select an option

Save remarkablemark/76f4e7fb1e1c9414aa0e7ad9a454b8b4 to your computer and use it in GitHub Desktop.
Loading spinner using HTML + CSS
<div id="spinner" role="progressbar" aria-label="Loading"></div>
<style>
#spinner {
position: fixed;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
border: 4px solid #ddd;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
transform: translate(-50%, -50%) rotate(360deg);
}
}
</style>
<div id="spinner" role="progressbar" aria-label="Loading"></div>
<style>
#spinner {
width: 50px;
height: 50px;
border: 4px solid #ddd;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment