-
Dropdown Navigation Menu
HTML
CSS
JavaScript
Brand
.
Explore ▾
Dark Themes
Glass Effects
UI Patterns
Showcase
Contact
Join Now
:root { /* We use a semi-transparent black for the glass effect */ --glass-bg: rgba(10, 10, 10, 0.75); --dropdown-bg: linear-gradient(145deg, #1a1a1a, #0a0a0a); --accent: #818cf8; --text-bright: #ffffff; --text-dim: #d1d5db; --border: rgba(255, 255, 255, 0.12); } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; } body { /* Using a high-quality dark abstract background */ background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=2564&auto=format&fit=crop'); background-size: cover; background-position: center; background-attachment: fixed; height: 100vh; color: white; } /* --- Modern Glass Navbar --- */ .navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 8%; background: var(--glass-bg); backdrop-filter: blur(12px); /* This blurs the background image */ -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 60px; z-index: 1000; } .logo { font-size: 1.6rem; font-weight: 800; letter-spacing: -1px; } .logo span { color: var(--accent); } .nav-links { display: flex; list-style: none; gap: 30px; } .nav-links a { text-decoration: none; color: var(--text-dim); font-weight: 500; font-size: 0.95rem; transition: 0.3s; } .nav-links a:hover { color: var(--text-bright); } /* --- Shaded Dropdown --- */ .dropdown { position: relative; } .dropdown-menu { position: absolute; top: 100%; left: 0; margin-top: 15px; background: var(--dropdown-bg); border: 1px solid var(--border); border-radius: 12px; min-width: 200px; padding: 8px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); /* Animation */ opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); } .dropdown-menu li { list-style: none; } .dropdown-menu a { display: block; padding: 12px 16px; border-radius: 8px; } .dropdown-menu a:hover { background: rgba(255, 255, 255, 0.05); color: var(--accent); } /* --- Hero Section --- */ .hero { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 80vh; text-align: center; } .hero h1 { font-size: 4rem; margin-bottom: 1rem; text-shadow: 0 10px 30px rgba(0,0,0,0.5); } .btn { background: var(--accent); color: white; padding: 12px 30px; border-radius: 8px; text-decoration: none; font-weight: 600; margin-top: 0px; transition: 0.3s; } .btn:hover { filter: brightness(1.2); box-shadow: 0 0 20px rgba(129, 140, 248, 0.4); }
Live Preview