<!DOCTYPE html>
<html>
<head>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #f9f9f9;
}
.spinner {
width: 60px;
height: 60px;
border: 8px solid #ddd;
border-top: 8px solid blue;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="spinner"></div>
</body>
</html>
Explanation:
border-top
gives a colored arc.@keyframes
rotates the circle infinitely.
Leave a Reply