How to Create a Glassmorphism Effect in CSS

Build a frosted-glass panel in CSS. Set the blur, transparency, colour and border, preview it live over a backdrop, then copy the code.

Updated 4 min read By CodingEagles
Free tool Glassmorphism CSS Generator Frosted-glass CSS from blur, tint, saturation and border, with a live preview. Open tool

Glassmorphism is the frosted-glass look: a card or menu that blurs and tints whatever sits behind it, so it reads like a pane of translucent glass. It leans on one CSS property, backdrop-filter, plus a semi-transparent background and a soft border. The tricky part is balancing the numbers, and that is easier to do by eye than by trial and error in code.

The Glassmorphism CSS Generator previews the panel over a colourful backdrop and gives you the exact CSS to copy.

TL;DR: Blur the backdrop, keep the background mostly transparent, add a faint border, and put the panel over something with detail so the frost is visible.

The three parts that matter

A convincing glass panel is really three settings working together.

  • Blur. backdrop-filter: blur(...) is what frosts the content behind the panel. Around 10 to 18 pixels reads as glass without turning to mush.
  • Transparency. The background needs to be mostly see-through, usually a white or light tint at low opacity. Too opaque and the blur disappears; too transparent and the panel loses its shape.
  • Border. A thin, faintly white border catches the light along the edge and separates the panel from the background.

Why the background matters

Frosted glass only looks like glass when there is something to frost. backdrop-filter blurs the pixels behind the element, so a panel floating over a flat colour shows no effect at all. Put it over a photo, a gradient or a busy hero section, and the blur suddenly has something to work with. The generator previews over a gradient on purpose, so what you see is honest.

Add saturation for depth

A small saturation boost on the backdrop filter makes the colours behind the glass richer and gives the panel more presence. Push it too far and it looks artificial, so keep it modest. The saturation slider lets you find that line while watching the preview.

Copy and ship

Once the panel looks right, copy the CSS and paste it onto your card, modal or navigation bar. The generator includes the -webkit- line so it holds up in Safari as well.

If you also need gradients, shadows or rounded corners for the same component, the CSS Generator covers those alongside a glass mode. Start with the Glassmorphism CSS Generator.

Frequently asked questions

What CSS makes the frosted-glass effect?
The core is backdrop-filter with a blur, a semi-transparent background, and a light border. The backdrop-filter blurs whatever sits behind the element, and the low background opacity lets that blur show through.
Why is my glassmorphism not showing any blur?
backdrop-filter only blurs content behind the element. If there is nothing behind the panel, or the background opacity is too high, there is nothing to frost. Place the panel over an image or a gradient and lower the background opacity.
Does backdrop-filter work in every browser?
It works in current versions of the major browsers. Including the -webkit-backdrop-filter line alongside the standard one covers Safari, and the generator adds both for you.

Ready to try it?

Frosted-glass CSS from blur, tint, saturation and border, with a live preview. Free, in-browser, and 100% private — your data never leaves your device.

Open the Glassmorphism CSS Generator