Loading icon with CSS
How to make a loading icon without an image? You can do it with CSS and its animations.
If we want the loading icon to be a circle, we use the border-radius property. You can rotate anything, even a square or a line. The code could look like this:
<style>
.loader {
width: 60px;
height: 60px;
animation: spin 1s infinite linear;
border-radius: 50%;
border-bottom: 2px solid #000000;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>
<div class="loader"></div>