<nav class="nav"> <div class="logo">studio.</div> <ul class="links"> <li><a href="#">Work</a></li> <li><a href="#">About</a></li> <li><a href="#">Journal</a></li> <li><a href="#">Contact</a></li> </ul> <a href="#" class="cta">Start project</a> </nav>
.nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid #eee; } .links { display: flex; gap: 28px; list-style: none; } .cta { padding: 8px 18px; border-radius: 999px; background: #111; color: #fff; }
Scroll to see the blur in action
The nav stays pinned to the top and the blur picks up whatever colors sit behind it. Works especially well on colorful or image-heavy sites.
Keep scrolling — notice how the background fades as content slides under the bar.
<nav class="nav"> <div class="logo">aurora</div> <ul class="links"> <li><a href="#">Shop</a></li> <li><a href="#">Journal</a></li> <li><a href="#">Stores</a></li> </ul> </nav> <!-- content that scrolls underneath --> <main> <h2>Scroll to see the blur in action</h2> <p>The nav stays pinned to the top and the blur picks up whatever colors sit behind it. Works especially well on colorful or image-heavy sites.</p> <p>Keep scrolling — notice how the background fades as content slides under the bar.</p> </main>
/* Stays at the top while page scrolls */ .nav { position: sticky; top: 0; z-index: 2; background: rgba(255,255,255,.7); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid rgba(255,255,255,.5); }
<!-- Hidden checkbox drives everything --> <input type="checkbox" id="burger" class="burger-toggle"> <nav class="nav"> <div class="logo">orbit</div> <!-- Label acts as the button --> <label for="burger" class="burger-btn"> <span></span><span></span><span></span> </label> </nav> <div class="mobile-menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Features</a></li> <li><a href="#">Pricing</a></li> <li><a href="#">Contact</a></li> </ul> </div>
/* Hide the actual checkbox */ .burger-toggle { display: none; } /* Menu panel uses max-height for smooth open */ .mobile-menu { max-height: 0; overflow: hidden; transition: max-height .4s ease; } /* When checked, expand the menu */ .burger-toggle:checked ~ .mobile-menu { max-height: 300px; } /* Animate the 3 burger bars into an X */ .burger-toggle:checked ~ .nav span:nth-child(1) { transform: rotate(45deg); top: 9px; } .burger-toggle:checked ~ .nav span:nth-child(2) { opacity: 0; } .burger-toggle:checked ~ .nav span:nth-child(3) { transform: rotate(-45deg); top: 9px; }
// Prefer a real button + JS toggle for accessibility (announces state). // Use this in place of the checkbox hack if you want screen readers // to hear "expanded / collapsed" when the menu opens. const btn = document.querySelector('.burger-btn'); const menu = document.querySelector('.mobile-menu'); btn.addEventListener('click', () => { const open = menu.classList.toggle('open'); btn.setAttribute('aria-expanded', open); btn.setAttribute('aria-label', open ? 'Close menu' : 'Open menu'); }); // Close the menu when any link inside it is clicked menu.querySelectorAll('a').forEach(a => { a.addEventListener('click', () => { menu.classList.remove('open'); btn.setAttribute('aria-expanded', 'false'); }); });
Hover "Shop" to reveal the mega menu ↑
<nav class="nav"> <div class="logo">emporium</div> <ul class="links"> <li class="drop"> <a href="#">Shop ▾</a> <div class="mega"> <div class="mega-col"> <h4>Clothing</h4> <ul> <li><a href="#">Tops</a></li> <li><a href="#">Bottoms</a></li> <li><a href="#">Outerwear</a></li> </ul> </div> <div class="mega-col"> <h4>Accessories</h4> <ul> <li><a href="#">Hats</a></li> <li><a href="#">Bags</a></li> <li><a href="#">Eyewear</a></li> </ul> </div> </div> </li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> </nav>
.drop { position: relative; } .mega { position: absolute; top: calc(100% + 10px); width: 520px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 22px; background: #fff; border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.08); opacity: 0; visibility: hidden; transition: all .2s; } .drop:hover .mega { opacity: 1; visibility: visible; }
Dashboard
Your main content area goes here.
<div class="layout"> <aside class="side"> <div class="brand">moonbase</div> <ul> <li><a href="#">Home</a></li> <li class="active"><a href="#">Dashboard</a></li> <li><a href="#">Projects</a></li> <li><a href="#">Team</a></li> <li><a href="#">Messages</a></li> <li><a href="#">Settings</a></li> </ul> </aside> <main class="panel"> <h3>Dashboard</h3> <p>Your main content area goes here.</p> </main> </div>
/* Two-column grid for sidebar + main */ .layout { display: grid; grid-template-columns: 220px 1fr; } .side { background: #0f172a; color: #cbd5e1; padding: 24px 16px; } .side li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; } .side li.active a { background: rgba(236,72,153,.15); color: #fbcfe8; }
<!-- Slash style --> <ul class="bc"> <li><a href="#">Home</a></li> <li><a href="#">Labs</a></li> <li><a href="#">Gallery</a></li> <li class="current">Masonry</li> </ul> <!-- Arrow style --> <ul class="bc arrows"> <li><a href="#">Shop</a></li> <li><a href="#">Men</a></li> <li><a href="#">Shoes</a></li> <li class="current">Runners</li> </ul> <!-- Pill style --> <ul class="bc pills"> <li><a href="#">Docs</a></li> <li><a href="#">Components</a></li> <li class="current">Button</li> </ul>
.bc { display: flex; gap: 8px; list-style: none; color: #666; } /* The separator comes from ::before on 2nd+ items */ .bc li + li::before { content: "/"; color: #ccc; margin-right: 8px; } .bc.arrows li + li::before { content: "›"; } .bc.pills li { background: #f4f4f5; padding: 4px 12px; border-radius: 999px; } .bc .current { color: #111; font-weight: 600; }
<nav class="tabbar"> <button><i class="ph ph-house"></i>Home</button> <button class="active"><i class="ph-fill ph-magnifying-glass"></i>Search</button> <button><i class="ph ph-bell"></i>Alerts</button> <button><i class="ph ph-user-circle"></i>Profile</button> </nav>
.tabbar { position: fixed; /* or absolute in a container */ bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; background: #fff; padding: 8px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.12); } .tabbar button { display: flex; flex-direction: column; padding: 8px 16px; border-radius: 999px; } .tabbar .active { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; }
// Tap any tab to make it the active one const buttons = document.querySelectorAll('.tabbar button'); buttons.forEach(btn => { btn.addEventListener('click', () => { buttons.forEach(b => b.classList.remove('active')); btn.classList.add('active'); }); });
<nav class="pill-nav"> <a href="#" class="active">Home</a> <a href="#">Catalog</a> <a href="#">Blog</a> <a href="#">Pricing</a> <a href="#">Contact</a> </nav>
.pill-nav { display: inline-flex; padding: 6px; gap: 4px; background: rgba(255,255,255,.6); backdrop-filter: blur(10px); border-radius: 999px; } .pill-nav a { padding: 8px 18px; border-radius: 999px; font-weight: 600; text-decoration: none; color: #555; } .pill-nav a.active { background: #111; color: #fff; }