Toggle navigation
☰
HTML
CSS
Scripting
Database
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tailwind CSS Floating Glassmorphism Navbar</title> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.2.1"></script> </head> <body class="bg-indigo-50 min-h-[150vh] p-4 flex flex-col items-center"> <!-- Background Blobs --> <div class="fixed inset-0 pointer-events-none -z-10"> <div class="absolute top-20 left-20 w-64 h-64 bg-indigo-300 rounded-full mix-blend-multiply filter blur-3xl opacity-40 animate-pulse"></div> <div class="absolute top-40 right-20 w-80 h-80 bg-purple-300 rounded-full mix-blend-multiply filter blur-3xl opacity-40 animate-pulse delay-700"></div> <div class="absolute bottom-20 left-1/2 -translate-x-1/2 w-96 h-96 bg-pink-200 rounded-full mix-blend-multiply filter blur-3xl opacity-30 animate-pulse delay-1000"></div> </div> <nav class="fixed top-8 z-50 bg-white/30 backdrop-blur-2xl border border-white/20 px-8 h-16 rounded-full flex items-center justify-between gap-12 shadow-2xl ring-1 ring-black/5" x-data="{ open: false }"> <div class="font-black text-2xl text-indigo-900 tracking-tighter">GLASS.</div> <div class="hidden md:flex items-center space-x-10 text-sm font-bold text-indigo-900/70 uppercase tracking-widest"> <a href="##" class="hover:text-indigo-900 transition">Works</a> <a href="##" class="hover:text-indigo-900 transition">Studios</a> <a href="##" class="hover:text-indigo-900 transition">Contact</a> </div> <button class="bg-indigo-900 text-white px-6 h-10 rounded-full text-xs font-black uppercase transition-all shadow-xl hover:scale-105 active:scale-95 shadow-indigo-900/20">Hire Us</button> <!-- Mobile Button --> <button @click="open = !open" class="md:hidden p-2 text-indigo-900"> <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M12 12h8M4 18h16" /> </svg> </button> <!-- Mobile Menu Overlay --> <div x-show="open" @click.away="open = false" x-transition:enter="transition ease-out duration-200" x-transition:enter-start="opacity-0 scale-95" x-transition:enter-end="opacity-100 scale-100" class="absolute top-20 left-0 right-0 bg-white/80 backdrop-blur-3xl rounded-3xl p-8 space-y-6 shadow-2xl border border-white md:hidden" style="display: none;" > <a href="##" class="block text-2xl font-black text-indigo-900">Works</a> <a href="##" class="block text-2xl font-black text-indigo-900">Studios</a> <a href="##" class="block text-2xl font-black text-indigo-900 border-b border-indigo-100 pb-6">Contact</a> <button class="block w-full bg-indigo-900 text-white py-4 rounded-2xl font-black text-lg">Hire Us</button> </div> </nav> <p class="mt-64 text-sm font-bold text-indigo-900/40 uppercase tracking-widest leading-loose text-center">A beautiful floating glassmorphism navbar pattern with a backdrop-blur effect that adapts perfectly to different background colors.</p> <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> </body> </html>