Build a frosted glass panel from backdrop-filter, a translucent background and a hairline border, previewed over a patterned backdrop.
Text on a frosted panel has whatever contrast the backdrop happens to give it, and that changes as the page scrolls. The preview sits over a deliberately busy background for that reason. Check the text against the lightest and darkest parts of whatever will really be behind it.
.glass {
background: rgb(255 255 255 / 0.12);
-webkit-backdrop-filter: blur(12px) saturate(160%);
backdrop-filter: blur(12px) saturate(160%);
border: 1px solid rgb(255 255 255 / 0.2);
border-radius: 16px;
}CSS Glassmorphism Generator runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
The frosted glass effect is three declarations working together, and leaving any one of them out is why most attempts look like a grey box. `backdrop-filter: blur()` blurs what is behind the element; a translucent background tints that blur so it reads as a surface rather than a smear; and a hairline border catches the edge so the panel has a boundary at all. The saturation boost is optional and is what makes the effect look like glass rather than frost.
`backdrop-filter` only has something to blur if there is something behind it. On a flat background it does nothing visible, which is the single most common reason it appears not to work. The preview here sits the panel over a patterned backdrop for exactly that reason — on a plain white page you would be looking at a grey rectangle and concluding the CSS was broken.
There is a real accessibility cost to be deliberate about. Text on a translucent panel has a contrast ratio that changes with whatever scrolls behind it, so a label that passes over one part of a background can fail over another. The honest approach is to make the panel opaque enough that the worst case still passes, and to check it against the busiest part of the backdrop rather than the calmest.
It is also one of the more expensive things you can ask a browser to do: the backdrop has to be sampled and blurred on every frame the panel or its background moves. One fixed header is fine. A long scrolling list of glass cards is where phones start dropping frames, and reducing the blur radius helps more than reducing the panel count.
Almost always because there is nothing behind the element to blur. On a flat background a blurred backdrop looks identical to no blur. It also requires the element to be at least slightly transparent — a fully opaque background hides the blurred backdrop completely.
For Safari, yes. Safari supports backdrop-filter only under -webkit-backdrop-filter, so the output includes both and the prefixed one first.
Not automatically, and it needs care. The contrast ratio of text on a translucent panel changes with whatever is behind it, so a label can pass over one region of a background and fail over another. Make the tint opaque enough that the busiest part of your backdrop still passes.
Yes, comparatively. The backdrop is resampled and blurred whenever the panel or anything behind it moves. A single fixed header is fine; a scrolling list of glass cards is where phones start dropping frames, and a smaller blur radius helps more than fewer panels.
It sits the panel over a patterned backdrop so the blur has something to act on, which is the only way to see what the effect really does. Over a plain colour you would see a grey rectangle.