TR

Home / Guides / How to Make Glassmorphism (Frosted Glass Effect) With CSS

How to Make Glassmorphism (Frosted Glass Effect) With CSS

Updated: October 13, 2026 · AracMerkezi

▶ Open Glassmorphism CSS Generator

Glassmorphism is a design approach that gives a "frosted glass" effect by blurring the content behind an interface element. It is popular for cards, menus and modal windows. You can achieve the effect with a few lines of CSS.

Basic CSS

The effect has four parts:

  1. Semi-transparent background: background: rgba(255, 255, 255, 0.2);
  2. Blurring the backdrop: backdrop-filter: blur(12px);
  3. A thin border: border: 1px solid rgba(255, 255, 255, 0.3);
  4. Soft shadow and corners: box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); border-radius: 16px;

For some versions of Safari, a prefix is also added: -webkit-backdrop-filter: blur(12px);

The most important requirement: there must be something visual behind it

backdrop-filter blurs the pixels behind the element. If the background is plain white, there is nothing to blur and the effect goes unnoticed. To see the effect, put an image, colorful shapes or a gradient behind it. The CSS Gradient Generator makes it easier to prepare a gradient.

How to choose the values?

PropertyTypical rangeEffect
Background opacity0.1 – 0.35A low value is more transparent, a high value is more matte
Blur8 – 20 pxA high value erases more of the background
Saturation (saturate)120 – 180%Brightens the colors behind the glass
Border opacity0.2 – 0.4Makes the edge of the glass more distinct

Example with saturation: backdrop-filter: blur(12px) saturate(150%);

Support and fallback

backdrop-filter works in most modern browsers, but it is not supported in older versions and some specialized browsers. When it is not supported, the glass remains a semi-transparent color and the text can become unreadable. The safe way is to give an opaque background first and make it transparent only if there is support:

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) { .glass { background: rgba(255,255,255,0.2); } }

Outside this rule, define a darker, opaque fallback color for .glass.

Performance

Blurring is expensive for the browser. On large areas, with many overlapping elements, and on low-power mobile devices, it can cause stutter. Tips:

Accessibility and readability

The glass effect changes the content behind the text; if the background moves or has colorful regions, the contrast can shift. Check the contrast ratio between the text and the worst background point; for WCAG AA, aim for at least 4.5:1 for normal text. Use the Color Contrast Checker (WCAG) for this. If you cannot achieve sufficient contrast for the text, reduce the glass transparency or add a dark layer behind it. For users who have a reduced-motion preference, consider disabling moving backgrounds.

A ready example

On a colorful gradient background, you can give the .glass class the following: a semi-transparent white background (0.2), 12 pixels of blur, 150% saturation, a 1-pixel light border, 16-pixel corners and a light shadow. On dark-themed pages, using dark blue or black (e.g., rgba(15, 23, 42, 0.4)) instead of white as the glass color makes the text more readable.

Common mistakes

Tools

The Glassmorphism CSS Generator produces ready CSS from color, opacity, blur and corner values. To adjust the shadow separately, see the CSS Box Shadow Generator.

Frequently asked questions

Which CSS property is needed for glassmorphism?

Basically, a semi-transparent background color is used together with backdrop-filter: blur(); the border and shadow complete the look.

Why isn't the effect visible?

backdrop-filter blurs the content behind the element; if the background is a plain color it goes unnoticed. Put an image or gradient behind it.

Does the glass effect hurt readability?

Text contrast can drop as the background changes; aim for at least 4.5:1 and, if necessary, reduce the transparency or add a dark layer.

Tools mentioned in this guide

More guides

This article is for general information only and is not legal, financial or medical advice. We are not an official institution.