{
CF
}
Code
Fronts
Back to CSS Hero Sections
Particle Starfield
Pure CSS
Edit any tab — preview updates live
CSS
HTML
Reset
Copy
.hs-star { position: relative; width: 100%; min-height: clamp(240px, 32vh, 100vh); padding: clamp(20px, 4vh, 60px) clamp(16px, 4vw, 40px); background: radial-gradient(80% 80% at 50% 100%, #1a0a3a 0%, #06060c 70%); display: flex; align-items: center; justify-content: center; overflow: hidden; font-family: system-ui, sans-serif; color: #f0eeff; text-align: center; } .hs-star-bg, .hs-star-bg2 { position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.85), transparent), radial-gradient(1px 1px at 60px 70px, rgba(255,255,255,0.7), transparent), radial-gradient(1.5px 1.5px at 110px 40px, rgba(255,255,255,0.9), transparent), radial-gradient(1px 1px at 160px 90px, rgba(167,139,250,0.7), transparent), radial-gradient(1px 1px at 200px 20px, rgba(255,255,255,0.6), transparent), radial-gradient(1.5px 1.5px at 240px 70px, rgba(255,108,138,0.65), transparent), radial-gradient(1px 1px at 280px 50px, rgba(255,255,255,0.7), transparent); background-size: 320px 120px; background-repeat: repeat; animation: hs-star-pan 60s linear infinite; } .hs-star-bg2 { background-image: radial-gradient(1px 1px at 30px 80px, rgba(255,255,255,0.55), transparent), radial-gradient(1px 1px at 90px 30px, rgba(167,139,250,0.6), transparent), radial-gradient(1px 1px at 150px 100px, rgba(255,255,255,0.45), transparent), radial-gradient(1px 1px at 220px 50px, rgba(255,255,255,0.65), transparent), radial-gradient(1px 1px at 280px 110px, rgba(46,184,138,0.5), transparent); background-size: 320px 160px; animation-duration: 90s; opacity: 0.7; } .hs-star-c { position: relative; z-index: 1; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 10px; } .hs-star-eye { font-family: monospace; font-size: clamp(9px, 1.3vw, 11px); letter-spacing: 0.14em; color: #a78bfa; text-transform: uppercase; } .hs-star h1 { margin: 0; font-size: clamp(24px, 5.5vw, 64px); font-weight: 900; line-height: 1.05; letter-spacing: -0.03em; background: linear-gradient(135deg, #fff 30%, #a78bfa 100%); -webkit-background-clip: text; background-clip: text; color: transparent; } .hs-star p { margin: 0; font-size: clamp(11px, 1.5vw, 15px); color: #b8b6d4; } .hs-star-cta { padding: 9px 20px; border-radius: 7px; background: linear-gradient(135deg, #7c6cff, #a78bfa); color: #fff; font-size: clamp(11px, 1.5vw, 14px); font-weight: 700; text-decoration: none; margin-top: 4px; box-shadow: 0 8px 32px rgba(124,108,255,0.4); transition: transform 0.15s; } .hs-star-cta:hover { transform: translateY(-2px); } @keyframes hs-star-pan { to { transform: translateX(-320px); } } @media (prefers-reduced-motion: reduce) { .hs-star-bg, .hs-star-bg2 { animation: none; } }
<section class="hs-star"> <div class="hs-star-bg" aria-hidden="true"></div> <div class="hs-star-bg hs-star-bg2" aria-hidden="true"></div> <div class="hs-star-c"> <span class="hs-star-eye">⌥ Cosmic build</span> <h1>Ship to the moon.</h1> <p>Built for ambitious teams who measure in light-years.</p> <a class="hs-star-cta" href="#">Launch your project</a> </div> </section>
Live preview
Ready