Tools · CSS · Glassmorphism-Effekt erstellen · Anleitungen · Building a Frosted-Glass Navbar That Doesn't Disappear on Old Browsers

Building a Frosted-Glass Navbar That Doesn't Disappear on Old Browsers

4 Min. Lesezeit

A translucent, blurred navigation bar sitting fixed at the top of the page while content scrolls behind it is one of the most common real-world uses of glassmorphism - and unlike a single decorative card, a navbar has two extra requirements a card doesn't: whatever text sits inside it has to stay legible over any content that scrolls underneath, and the bar has to still function sensibly in a browser that doesn't support the blur at all.

A frosted navbar over scrolling content, with a fallback below A page mockup with a translucent blurred navbar fixed across the top, colourful content blocks scrolling visibly through the blur beneath it. Below, a smaller comparison shows the same navbar in a browser without blur support, still legible thanks to a solid fallback background colour. content scrolls, blurred, through the bar no blur support - solid fallback colour, still readable
The navbar's own solid background colour is what saves it when blur isn't available.

Why a navbar needs more contrast than a card

A single glass card usually sits over one deliberately-chosen backdrop, so its tint and opacity can be tuned once and left alone. A fixed navbar sits over every section of the page as the visitor scrolls - a bright photo in one section, plain white in the next, dark text in another - and its own text still has to stay legible against all of them. Pushing tint opacity higher than the 20% it starts from after Start fresh, tested against the busiest, most colourful section of the actual page it'll sit on rather than against the tool's own demo backdrops, gives the navbar's own text more consistent contrast at the cost of a less dramatic see-through effect. That trade is usually worth making for a navbar specifically, even where a lighter tint reads better on a single static card sitting over one known backdrop.

Making it stick without recreating the blur math by hand

Whatever produces the "fixed to the top while the page scrolls" behaviour is a layout property (typically position: sticky or position: fixed) applied on top of the glass CSS, not a replacement for any of it - the four glass properties (background, backdrop-filter, border, border-radius) still do exactly the same job regardless of how the element is positioned on the page. Glassmorphism generator only produces the visual recipe, tuned against a demo backdrop that stands in for whatever content will actually scroll underneath it in production - the positioning itself stays a normal CSS decision made separately.

What actually happens in a browser without backdrop-filter support

The generated CSS always includes both backdrop-filter and its -webkit- prefix, but in a browser missing both, the blur simply doesn't render - the navbar falls back to its own tint colour as a flat, translucent (or, at a higher opacity setting, effectively solid-looking) background. A navbar tuned with a reasonably high tint opacity degrades gracefully this way: no blur, but still a distinct, legible bar with its text intact. A navbar tuned very light and barely tinted, relying almost entirely on the blur itself for separation from the content behind it, degrades far worse - closer to invisible than to "less impressive." Testing the tint opacity alone, blur removed, is a fast way to check which case a given setting falls into before shipping it.

Two things worth checking specifically before it ships

Blurring a large, constantly-visible area like a full-width fixed navbar is more demanding on the browser's compositor than blurring one small card, since the blur recalculates continuously as content scrolls behind it - worth checking on the actual, often lower-powered devices real visitors use, not only on a fast development machine, before committing to it site-wide. Second, backdrop-filter creates its own new stacking context on the element it's applied to, the same way transform or filter do - which matters if the navbar also holds a dropdown menu meant to sit above other page content, since a z-index set on that dropdown is now scoped inside the navbar's own stacking context rather than the page's top-level one. Neither issue is a reason to avoid the effect on a navbar; both are worth testing for specifically, because a glass navbar that stutters on scroll, or a dropdown that quietly renders behind content it should cover, are both easy to miss in a quick desktop check.

For every control this recipe is built from, see the how-to guide. For why the effect depends on real content behind it in the first place, see the background.

Glassmorphism generator lets a tint-opacity value be checked against multiple demo backdrops before it goes anywhere near a real, scrolling page.

Glassmorphism-Effekt erstellen kostenlos ausprobieren Glassmorphism-Effekt erstellen