CSSApril 2026 ยท 6 min read

How to Create Glassmorphism Effects in CSS

Glassmorphism is a UI design trend that creates frosted glass effects โ€” semi-transparent surfaces that blur the content behind them. Apple popularized it in macOS Big Sur and iOS, and it's now widely used in modern web interfaces for cards, modals, sidebars, and navigation bars.

๐Ÿ”ฎ
Try the Glassmorphism Generator
Free, no signup
โ†’
DG
Derek Giordano
Designer & Developer
In this guide
01The Basic Glass Effect02Tuning the Effect03Glassmorphism on Dark vs Light Backgrounds04Performance and Accessibility
โšก Key Takeaways
  • Build frosted glass UI elements with CSS backdrop-filter, background blur, and semi-transparent layers.
  • The Basic Glass Effect.
  • Covers tuning the effect.
  • Covers glassmorphism on dark vs light backgrounds.
  • Covers performance and accessibility.

The Basic Glass Effect

The core of glassmorphism is three CSS properties working together:

.glass-card {

background: rgba(255, 255, 255, 0.05);

backdrop-filter: blur(16px);

-webkit-backdrop-filter: blur(16px);

border: 1px solid rgba(255, 255, 255, 0.1);

border-radius: 16px;

}

backdrop-filter: blur() blurs everything behind the element. The semi-transparent background adds a tinted layer on top of the blur. The subtle border defines the edge and catches light โ€” without it, glass elements blend into their surroundings.

Tuning the Effect

Three variables control the glassmorphism feel: blur radius, background opacity, and border opacity. Higher blur (20โ€“40px) creates a more frosted, opaque look. Lower blur (8โ€“12px) creates a subtle, barely-there effect. Background opacity between 0.03โ€“0.10 works for dark themes; 0.3โ€“0.6 for light themes. The border should be barely visible (0.06โ€“0.15 opacity) โ€” too prominent and it looks like a regular bordered card.

๐Ÿ’ก Tip
Always include -webkit-backdrop-filter alongside backdrop-filter for Safari support. Without the prefix, the effect is invisible to roughly 25% of mobile users.

Glassmorphism on Dark vs Light Backgrounds

On dark backgrounds (common in dashboards and portfolios), use white-tinted glass: rgba(255,255,255,0.05). On light backgrounds, use dark-tinted glass: rgba(0,0,0,0.02) with a white border. The effect works best when there's colorful or textured content behind the glass element โ€” gradient backgrounds, images, or overlapping UI elements. On a flat, solid-color background, the blur has nothing to blur, and the effect falls flat.

โš  Warning
On iOS Safari, backdrop-filter inside a position: fixed element can cause severe scroll performance issues. Test thoroughly on real iOS devices.

Performance and Accessibility

backdrop-filter triggers compositing on every frame during scrolling, which can cause jank on low-powered devices. Test on real mobile hardware before committing to the effect on large or frequently-scrolled elements. For accessibility, ensure text on glass surfaces meets WCAG contrast requirements โ€” the semi-transparent background can reduce contrast below acceptable levels depending on what's behind it. Test with worst-case backgrounds using the Contrast Checker. The Glassmorphism Generator lets you adjust blur, opacity, and border and preview the result against different backgrounds.

Frequently Asked Questions

What CSS property creates the glassmorphism effect?+
backdrop-filter: blur() is the core property. Combined with a semi-transparent background color and a subtle border, it creates the frosted glass look. Always include the -webkit- prefix for Safari support.
Does glassmorphism work in all browsers?+
backdrop-filter is supported in Chrome, Edge, Safari, and Firefox (since version 103). It works in all modern browsers. Always include -webkit-backdrop-filter for Safari compatibility.
Is glassmorphism accessible?+
It can be, but requires care. Text on glass surfaces must meet WCAG contrast requirements against the worst-case background behind the glass. Test with the Contrast Checker and consider adding a slightly more opaque background to ensure readability.
Try it yourself

Use the Glassmorphism Generator โ€” free, no signup required.

โšก Open Glassmorphism Generator
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.