Skip to content
UniKit

CSS frosted glass generator

Tune backdrop-filter blur, background colour and opacity, border, radius, shadow and inner glow, preview the frosted card over a gradient, and copy the full CSS with the -webkit- prefix.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Live preview

Glass card

It only reads as glass over gradients and imagery

Glass
12px
Background
20%
Border & radius
1px
30%
16px
Shadow
24px
20%
Inner glow
Add inner glow

Code

CSS
.glass-card {
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

backdrop-filter can only blur what actually sits behind the element: put the card on an image or gradient first, then tune the blur. With blur 0 the whole backdrop-filter declaration is omitted.

What this tool does

  • Build a frosted-glass card or overlay: dial in the blur, background and border opacity, radius and shadow, then copy the CSS — the -webkit- prefix is already included.
  • Debug "the glass effect does nothing": first make sure there is an image or gradient behind the card, then come back and raise the blur radius and background opacity.
  • Add a bit of thickness with the inner glow — the outer shadow and the inset glow are merged into a single box-shadow, so the declarations never override each other.
  • Preview a parameter set over a gradient backdrop before committing to radius and border width values.

Example

Input

Defaults: blur 12px, background #FFFFFF at 20%, border 1px #FFFFFF at 30%, radius 16px, shadow 24px #0F172A at 20%, inner glow off

Output

.glass-card {
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

The vertical offset of the shadow is half the blur radius (24 ÷ 2 = 12). With blur 0 the whole backdrop-filter declaration is omitted, and with border width 0 the border is omitted.

Frequently asked questions

Which browsers support backdrop-filter?

Chrome / Edge 76+, Safari 9+ (Safari needs the -webkit- prefix, which the generated CSS already carries) and Firefox 103+. IE and older Firefox do not support it at all and simply show a translucent block. For safety the output always includes a translucent background colour as a fallback.

Why are there two backdrop-filter lines in the output?

The first is the -webkit- prefixed version, which Safari still requires, and the second is the standard property. Browsers ignore the line they do not recognise.

The glass effect shows no change at all.

backdrop-filter can only blur content that really sits behind the element. If the card is over a flat colour or empty space nothing will happen — put it on top of an image, a gradient or scrolling content first.

How transparent should the background be?

It depends on the contrast behind it: 15%–30% usually works over light imagery, while dark backgrounds need 35% or more, otherwise the card blends into the backdrop. Raising the border opacity as well keeps the edge visible.

Do the inner glow and the outer shadow override each other?

No. They are merged into a single box-shadow — the outer shadow first, then the inset glow, comma separated — which is exactly how box-shadow layers work.

Can I enter rgb() or a colour name?

No. Colours must be #RGB / #RGBA / #RRGGBB / #RRGGBBAA (the leading # is optional) and opacity is set with the separate slider, so the output is consistently rgba().

Keywords:backdrop-filterglassmorphismfrosted glasscss blur

Related tools