SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/glass-navbars

7 CSS Glass and Liquid Glass Navbars

5 Pure CSS2 with JSPublished 2026-10-05Free · no sign-up

Seven glassmorphic and liquid glass navigation bars: classic frosted glass, a floating pill, the liquid glass look with specular highlights, a dark smoked bar over a bright photo, a navbar whose dropdown is glass too, a dock of app icons and a segmented control on glass.

01. Frosted Glass Navbar

GlassNavbar

A navbar over colourful shapes with backdrop-filter: blur and a translucent white fill, the classic frosted glass. A thin light border on the top edge sells the glass edge, and the fill is strong enough that the links pass contrast even where blur is unsupported.

View code
<div class="gn1"><span class="b1" aria-hidden="true"></span><span class="b2" aria-hidden="true"></span><nav aria-label="Main"><a class="logo" href="#home">Lumen</a><a href="#features">Features</a><a href="#pricing">Pricing</a></nav></div>
.gn1 { position: relative; width: 420px; max-width: 100%; height: 220px; overflow: hidden; border-radius: 18px; background: #0b1020; font: 600 14px Inter, system-ui, sans-serif; }
.gn1 span { position: absolute; border-radius: 50%; }
.gn1 .b1 { width: 180px; height: 180px; left: -30px; top: 10px; background: #ec4899; } .gn1 .b2 { width: 200px; height: 200px; right: -40px; top: 40px; background: #06b6d4; }
.gn1 nav { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; background: rgba(15,23,42,.45); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); }
.gn1 a { color: #fff; text-decoration: none; } .gn1 .logo { margin-right: auto; font-weight: 900; }
.gn1 a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

02. Floating Glass Pill

GlassFloating

A compact navbar that floats as a rounded pill, centred over the page with a little gap from the top. The glass tint is a light white with a soft shadow, a look that suits light, photo-heavy pages.

View code
<div class="gn2"><div class="photo" aria-hidden="true"></div><nav aria-label="Main"><a href="#work" aria-current="page">Work</a><a href="#about">About</a><a href="#contact">Contact</a></nav></div>
.gn2 { position: relative; width: 420px; max-width: 100%; height: 220px; overflow: hidden; border-radius: 18px; font: 600 14px Inter, system-ui, sans-serif; }
.gn2 .photo { position: absolute; inset: 0; background: linear-gradient(#fde68a 0 35%, #fb923c 35% 60%, #9a3412 60%); }
.gn2 nav { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); display: flex; gap: 2px; padding: 5px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; background: rgba(255,255,255,.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 8px 24px -10px rgba(0,0,0,.3); }
.gn2 a { padding: 7px 14px; border-radius: 999px; color: #1c1917; text-decoration: none; }
.gn2 a[aria-current] { background: #1c1917; color: #fff; }
.gn2 a:focus-visible { outline: 2px solid #1c1917; outline-offset: 2px; }

03. Liquid Glass Navbar

Liquid glassNavbar

The liquid glass look: a heavier blur, a bright specular highlight along the top edge, an inner glow and a subtle refraction-like gradient border. It is all layered box-shadows and a masked gradient border, with no images or SVG filters.

View code
<div class="gn3"><span class="o1" aria-hidden="true"></span><span class="o2" aria-hidden="true"></span><nav aria-label="Main"><a href="#home">Home</a><a href="#explore" aria-current="page">Explore</a><a href="#library">Library</a></nav></div>
.gn3 { position: relative; display: grid; place-items: center; width: 420px; max-width: 100%; height: 220px; overflow: hidden; border-radius: 18px; background: linear-gradient(135deg, #1e1b4b, #0f172a); font: 600 14px Inter, system-ui, sans-serif; }
.gn3 span { position: absolute; border-radius: 50%; filter: blur(4px); }
.gn3 .o1 { width: 140px; height: 140px; left: 40px; top: 20px; background: #a855f7; } .gn3 .o2 { width: 120px; height: 120px; right: 50px; bottom: 10px; background: #22d3ee; }
.gn3 nav { position: relative; display: flex; gap: 4px; padding: 6px; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.06)); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(255,255,255,.12), inset 0 0 18px rgba(255,255,255,.12), 0 12px 30px -12px rgba(0,0,0,.6); }
.gn3 nav::before { content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,0) 40%, rgba(255,255,255,.35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none; }
.gn3 a { position: relative; padding: 8px 16px; border-radius: 999px; color: #fff; text-decoration: none; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.gn3 a[aria-current] { background: rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.gn3 a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

04. Dark Smoked Glass Bar

GlassDark

Glass does not have to be white: a dark smoked tint over a bright photo gives strong contrast for white links and a more serious tone. The tint is rgba black at 55 percent, which keeps the links readable on the lightest part of any image.

View code
<div class="gn4"><div class="photo" aria-hidden="true"></div><nav aria-label="Main"><a class="logo" href="#home">ALPINE</a><a href="#stays">Stays</a><a href="#book">Book</a></nav></div>
.gn4 { position: relative; width: 420px; max-width: 100%; height: 220px; overflow: hidden; border-radius: 18px; font: 600 14px Inter, system-ui, sans-serif; }
.gn4 .photo { position: absolute; inset: 0; background: linear-gradient(#e0f2fe 0 45%, #f8fafc 45% 55%, #94a3b8 55%); }
.gn4 nav { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: rgba(2,6,23,.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.gn4 a { color: #fff; text-decoration: none; } .gn4 .logo { margin-right: auto; letter-spacing: .2em; font-weight: 800; }
.gn4 a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

05. Glass Navbar with Glass Dropdown

GlassDropdown

The dropdown under a glass navbar should be glass too, or it looks pasted on. Both share the same tint, blur and border tokens through custom properties, and the dropdown is a disclosure button with aria-expanded.

View code
<div class="gn5"><span class="bg" aria-hidden="true"></span><nav aria-label="Main"><a href="#home">Nova</a><div class="dd"><button aria-expanded="false" aria-controls="gn5m">Products</button><div id="gn5m" class="menu" hidden><a href="#editor">Editor</a><a href="#cloud">Cloud</a></div></div></nav></div>
.gn5 { --tint: rgba(15,23,42,.5); --bd: rgba(255,255,255,.22); position: relative; width: 420px; max-width: 100%; height: 260px; overflow: hidden; border-radius: 18px; font: 600 14px Inter, system-ui, sans-serif; }
.gn5 .bg { position: absolute; inset: 0; background: radial-gradient(circle at 30% 70%, #f43f5e, transparent 45%), radial-gradient(circle at 75% 40%, #6366f1, transparent 45%), #0b1020; }
.gn5 nav { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--bd); border-radius: 14px; background: var(--tint); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.gn5 a, .gn5 button { color: #fff; text-decoration: none; }
.gn5 button { padding: 6px 10px; border: 0; border-radius: 8px; background: none; font: inherit; cursor: pointer; } .gn5 button[aria-expanded=true] { background: rgba(255,255,255,.12); }
.gn5 .dd { position: relative; }
.gn5 .menu { position: absolute; left: 0; top: calc(100% + 12px); display: grid; min-width: 150px; padding: 6px; border: 1px solid var(--bd); border-radius: 12px; background: var(--tint); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.gn5 .menu[hidden] { display: none; }
.gn5 .menu a { padding: 8px 10px; border-radius: 8px; font-weight: 500; } .gn5 .menu a:hover { background: rgba(255,255,255,.12); }
.gn5 a:focus-visible, .gn5 button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
var b = document.querySelector('.gn5 button'), m = document.getElementById('gn5m');
b.onclick = function () { var o = b.getAttribute('aria-expanded') !== 'true'; b.setAttribute('aria-expanded', o); m.hidden = !o; };
document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && !m.hidden) { b.click(); b.focus(); } });

06. Glass Dock with Hover Lift

GlassDock

A desktop-style dock of app icons on a glass shelf at the bottom, where the hovered or focused icon lifts and grows. Each icon is a link with a name, and a small dot under the current app marks it with aria-current as well.

View code
<div class="gn6"><span class="bg" aria-hidden="true"></span><nav aria-label="Apps"><a href="#mail" aria-label="Mail" aria-current="page">✉</a><a href="#notes" aria-label="Notes">✎</a><a href="#music" aria-label="Music">♫</a><a href="#photos" aria-label="Photos">❀</a></nav></div>
.gn6 { position: relative; display: grid; align-items: end; justify-items: center; width: 420px; max-width: 100%; height: 220px; padding-bottom: 14px; box-sizing: border-box; overflow: hidden; border-radius: 18px; }
.gn6 .bg { position: absolute; inset: 0; background: linear-gradient(160deg, #0ea5e9, #6366f1 50%, #ec4899); }
.gn6 nav { position: relative; display: flex; align-items: end; gap: 8px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 20px; background: rgba(255,255,255,.2); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.gn6 a { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.9); color: #1e1b4b; font-size: 20px; text-decoration: none; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.gn6 a[aria-current]::after { content: ""; position: absolute; bottom: -6px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.gn6 a:hover, .gn6 a:focus-visible { transform: translateY(-8px) scale(1.15); }
.gn6 a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .gn6 a { transition: none; } .gn6 a:hover, .gn6 a:focus-visible { transform: none; } }

07. Glass Segmented Navigation

GlassSegmented

A segmented control on glass where a brighter pill slides behind the selected item. The items are links with aria-current, the pill is a single element moved with transform, and its position is computed from the current link's box.

View code
<div class="gn7"><span class="bg" aria-hidden="true"></span><nav aria-label="View"><span class="pill" aria-hidden="true"></span><a href="#day" aria-current="page">Day</a><a href="#week">Week</a><a href="#month">Month</a></nav></div>
.gn7 { position: relative; display: grid; place-items: center; width: 380px; max-width: 100%; height: 180px; overflow: hidden; border-radius: 18px; font: 600 14px Inter, system-ui, sans-serif; }
.gn7 .bg { position: absolute; inset: 0; background: linear-gradient(135deg, #bbf7d0, #67e8f9 50%, #c4b5fd); }
.gn7 nav { position: relative; display: flex; padding: 4px; border: 1px solid rgba(255,255,255,.7); border-radius: 12px; background: rgba(255,255,255,.4); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.gn7 .pill { position: absolute; top: 4px; left: 0; height: calc(100% - 8px); border-radius: 9px; background: rgba(255,255,255,.95); box-shadow: 0 2px 6px rgba(15,23,42,.15); transition: transform .3s cubic-bezier(.2,.8,.2,1), width .3s; }
.gn7 a { position: relative; padding: 8px 16px; color: #0f172a; text-decoration: none; }
.gn7 a:focus-visible { outline: 2px solid #0f172a; outline-offset: 1px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .gn7 .pill { transition: none; } }
var nav = document.querySelector('.gn7 nav'), pill = nav.querySelector('.pill'), links = nav.querySelectorAll('a');
function to(a) { pill.style.width = a.offsetWidth + 'px'; pill.style.transform = 'translateX(' + a.offsetLeft + 'px)'; }
links.forEach(function (a) { a.onclick = function (e) { e.preventDefault(); links.forEach(function (x) { if (x === a) x.setAttribute('aria-current', 'page'); else x.removeAttribute('aria-current'); }); to(a); }; });
to(nav.querySelector('[aria-current]'));

About these CSS Glass and Liquid Glass Navbars

Blur plus a tint

backdrop-filter: blur() softens what is behind the bar, but the tint does the readability work. Choose a background alpha that gives the links enough contrast on their own, so browsers without blur still show a usable bar.

Liquid glass is light

The liquid glass look adds a bright top highlight, inner glows and a gradient border, all with inset box-shadows and a masked pseudo-element. It needs a colourful background to come alive.

Share glass tokens

Put the tint, blur and border colour in custom properties so the navbar, its dropdowns and any popovers use the same glass, rather than drifting apart.

Test on real backgrounds

Glass changes with whatever is behind it. Check the bar over the lightest and busiest parts of your page, not only over a gradient.

Frequently asked questions

Does backdrop-filter hurt performance?

Large blurred areas cost more than flat colour. Keep the glass area modest, as a navbar is.

Is liquid glass the same as glassmorphism?

It is a newer variation with stronger highlights and depth; the core is still a blurred translucent layer.

What about Firefox?

backdrop-filter is supported in current Firefox; older versions show the tint without blur.