· 5 min read
How to Build a Frosted-Glass CSS Card
Heshan Fernando
Co-founder & COO
You want that frosted-glass card look — a semi-transparent panel that blurs whatever’s behind it, popular in modern UI design — over a hero image or gradient background. The effect relies on backdrop-filter: blur(), combined with a semi-transparent background color and usually a subtle border, but tuning all of those together to get a card that looks genuinely frosted rather than just murky takes some back-and-forth.
The individual CSS properties involved aren’t exotic, but the effect is genuinely visual — you’re balancing blur amount, background opacity, and border subtlety against each other, and it’s much easier to judge that balance by eye than to calculate the right combination from first principles.
What the glassmorphism effect actually involves
The core of the effect is backdrop-filter: blur(), which blurs whatever’s visually behind an element, combined with a semi-transparent background color (usually white or a light color at low opacity) that lets some of that blurred background show through. A subtle border, often a thin, low-opacity white line, helps define the card’s edge without looking like a hard, opaque box, and a rounded corner radius softens the overall shape to match the “glass” aesthetic.
Getting a convincing result depends on the balance between these properties — too little blur and the background reads clearly through the card, undermining the frosted look; too much opacity on the background color and it stops looking like glass at all, reading as a solid, slightly tinted panel instead.
Why people get stuck here
- The effect depends on layering several properties correctly together. Blur, opacity, and border each contribute to the final look, and getting one wrong throws off the whole effect.
backdrop-filterneeds something visually interesting behind it to matter. Testing the effect against a flat, plain background doesn’t show whether the blur is actually working the way it will in your real layout.- Small opacity differences produce noticeably different results. The gap between “looks like frosted glass” and “looks like a slightly transparent gray box” can be a matter of a few percentage points in background opacity.
- Browser support and performance considerations aren’t always top of mind.
backdrop-filterhas broad but not universal support, and heavy blur values can have a performance cost worth being aware of on lower-powered devices.
What a good glassmorphism generator looks like
Live sliders for every relevant property
Direct control over blur, opacity, corner radius, and border lets you tune the balance between them visually, rather than guessing values and reloading a real page repeatedly.
Preview over a real gradient background
Since the effect only makes sense with something visually interesting behind it, previewing against a real gradient (rather than a flat color) shows you what the card will actually look like in a realistic context.
Copyable, ready-to-use CSS
The end goal is a CSS declaration for your stylesheet — the generator should produce that exact syntax as you adjust the sliders, not just a preview you have to reverse-engineer.
Common mistakes to avoid
- Setting background opacity too high, which turns the “frosted glass” look into a plain, slightly tinted solid panel.
- Testing the effect only against a flat background color, missing how it’ll actually look layered over a real photo or gradient.
- Using too heavy a blur value without considering the performance cost on lower-powered devices, especially if several glass cards appear on the same page.
- Skipping the subtle border, which often makes the difference between a card that reads as “glass” versus one that reads as just blurry.
- Not checking
backdrop-filterbrowser support for your specific audience, since it’s broadly but not universally supported.
How to do it with Glassmorphism Generator
Online Tool Store’s Glassmorphism Generator lets you adjust blur, opacity, radius, and border with live sliders over a real gradient preview, entirely in your browser.
- Adjust the blur slider to set how strongly the background behind the card blurs.
- Adjust background opacity to balance transparency against readability.
- Fine-tune the corner radius and border to complete the frosted-glass look.
- Copy the generated CSS directly into your stylesheet.
Because the preview renders over a real gradient rather than a flat background, what you see while adjusting sliders closely matches how the card will actually look in a real layout.
Frequently asked questions
Why doesn’t backdrop-filter seem to work on my card?
Check that there’s actually something visually behind the element for the blur to affect — over a flat, single-color background, the blur has no visible effect since there’s no detail to blur. Also confirm the browser you’re testing in supports backdrop-filter, since support isn’t universal.
How much blur should I use for a convincing frosted-glass effect?
There’s no single correct value — it depends on what’s behind the card and the overall aesthetic you’re going for. Start with a moderate blur and adjust while watching the live preview over a realistic background rather than picking a value in isolation.
Does the glassmorphism effect have a performance cost?
Heavy blur values, especially applied to multiple elements on the same page, can have a measurable rendering cost on lower-powered devices, so it’s worth testing on your actual target hardware rather than assuming it’s free.
Final thought
Glassmorphism is a visual balance between blur, transparency, and a subtle border — one that’s much easier to dial in by eye against a realistic background than to calculate from scratch. Preview it properly, then copy the finished CSS.