body { background-color: #001f3f; overflow: hidden; } .star { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.8); box-shadow: 0 0 10px rgba(255, 255, 255, 0.8); animation: twinkle 1.5s infinite alternate; } @keyframes twinkle { 0% { opacity: 0.5; } 100% { opacity: 1; } } @for $i from 1 through 100 { .star:nth-child(#{$i}) { width: random(3) + 1px; height: random(3) + 1px; top: random(100) + %; left: random(100) + %; } }
Aller au contenu