13 Nov 5 Simple Yet Beautiful CSS Loading Spinners
When creating a web application or website, adding a loading spinner can enhance the user experience by giving feedback while content loads. CSS loading spinners are lightweight, easy to implement, and avoid reliance on external images or libraries. Here are five simple yet beautiful CSS-only loading spinners you can easily integrate into your projects.
1. Classic Rotating Circle
The rotating circle is a simple but timeless spinner. This effect creates a subtle, smooth rotation, keeping users engaged without being too flashy.
<div class="spinner"></div>
.spinner, .dots div, .pulse, .bars div, .spinning-dots div {
display: inline-block;
margin: 10px;
}
.spinner {
width: 50px;
height: 50px;
border: 6px solid #ccc;
border-top-color: #a80d0d !important;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
2. Bouncing Dots
Bouncing dots are fun, dynamic, and catch the eye immediately. This type of spinner is perfect for a modern and playful look.
<div class="dots">
<div></div>
<div></div>
<div></div>
</div>
.dots {
display: flex;
justify-content: space-between;
width: 60px;
}
.dots div {
width: 10px;
padding: 10px;
height: 0px;
background-color: #a80d0d !important;
border-radius: 50%;
animation: bouncedots 0.6s infinite alternate;
}
.dots div:nth-child(2) { animation-delay: 0.2s; }
.dots div:nth-child(3) { animation-delay: 0.4s; }
@keyframes bouncedots {
to { transform: translateY(-15px); }
}
3. Pulsing Circle
The pulsing circle is a minimalistic and visually appealing loading indicator. It expands and contracts, drawing attention without being too distracting.
<div class="pulse"></div>
.pulse {
width: 40px;
height: 40px;
background-color: #a80d0d !important;
border-radius: 50%;
animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.5); opacity: 0.5; }
}
4. Loading Bars
Loading bars are great for a linear loading indicator that feels dynamic and engaging. This CSS-only animation creates three bars that expand and contract in sequence.
<div class="bars">
<div></div>
<div></div>
<div></div>
</div>
.bars {
display: flex;
gap: 5px;
}
.bars div {
width: 10px;
height: 30px;
background-color: #a80d0d !important;
animation: stretch 0.6s ease-in-out infinite alternate;
}
.bars div:nth-child(2) { animation-delay: 0.2s; }
.bars div:nth-child(3) { animation-delay: 0.4s; }
@keyframes stretch {
to { transform: scaleY(1.5); }
}
5. Spinning Dots Circle
This spinner creates a ring of dots that rotate around a central point, making it a stylish loading animation. It’s more elaborate than some, but still simple to create using CSS.
<div class="spinning-dots-container">
<div class="spinning-dots">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
.spinning-dots-container {
position: relative;
width: 50px; /* Adjust as needed */
height: 50px; /* Adjust as needed */
}
.spinning-dots {
position: absolute;
width: 100%;
height: 100%;
animation: dotSpin 1s linear infinite;
}
.spinning-dots div {
width: 10px;
height: 10px;
background-color: #a80d0d !important;
border-radius: 50%;
position: absolute;
}
.spinning-dots div:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.spinning-dots div:nth-child(2) { top: 50%; right: 0; transform: translateY(-50%); }
.spinning-dots div:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); }
.spinning-dots div:nth-child(4) { top: 50%; left: 0; transform: translateY(-50%); }
@keyframes dotSpin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
Conclusion
These CSS loading spinners provide stylish and engaging ways to indicate loading times. Each one is simple to create with CSS alone, keeping your page lightweight and responsive. Adjust the colors, sizes, and animation speeds to match your project’s design and make your loading indicators a smooth part of the user experience.