Glassmorphism Card CSS: Blur and Opacity Values That Work

PublishedToolGlassmorphism Card Generator

Contents
  1. Why matching the glass look by hand is such a hassle
  2. Building a glassmorphism card directly in CSS
  3. Where things usually get stuck in real projects
  4. Wrap-up
  5. Frequently asked questions

The translucent, glass-like card UI you see on the Apple iOS lock screen, on modern fintech dashboards, and in crypto wallet apps is called glassmorphism. You can build it with pure CSS by combining backdrop-filter: blur() with a semi-transparent background color and a border highlight. But you end up tweaking the blur value and opacity one step at a time and refreshing the browser until the glass looks right.

Summary ① A glassmorphism card is built from a combination of four CSS properties: background blur, a semi-transparent background color, a border highlight, and a shadow. ② Instead of editing values in code one at a time, you can adjust sliders for a live preview and copy the finished CSS right away. ③ For broad support down to older Safari and iOS, it's safer to include the -webkit-backdrop-filter prefix alongside backdrop-filter.

Why matching the glass look by hand is such a hassle

If backdrop-filter: blur() is too small, the blur is too weak; if it's too large, the shapes behind it disappear completely. The right value changes every time depending on the background image and the card size. You also have to line up the background color's transparency (alpha value), the border width, and how far the shadow spreads, so you end up editing code and refreshing over and over.

Building a glassmorphism card directly in CSS

A glassmorphism card is built from a combination of these four CSS properties.

  • Background blur: Set a value like backdrop-filter: blur(16px) and only the background behind the card gets blurred.
  • Semi-transparent background color: Instead of a fully opaque color, layer a low-opacity white like background: rgba(255, 255, 255, 0.12) so light from the background shows through.
  • Border highlight: Use border: 1px solid rgba(255, 255, 255, 0.25) to add a thin, bright edge around the card so it looks like light reflecting off the cut edge of glass.
  • Dimensional shadow: Use box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25) so the card looks like it's floating slightly above the background.

Here's an example of a dashboard card with those four properties applied.

<div class="glass-card">
  <div class="glass-icon">💎</div>
  <h3>Glassmorphism Card</h3>
  <p>An aesthetic layered stylesheet interaction with a translucent frosted-glass feel.</p>
  <button class="glass-btn">Learn more</button>
</div>
.glass-card {
  width: 340px;
  padding: 36px 28px;
  background: rgba(255, 255, 255, 0.12);

  /* Vendor prefix fallback for backdrop blur rendering */
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);

  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
  color: #ffffff;
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.35);
}

.glass-btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

Note Instead of changing the background, blur, opacity, border, and shadow one by one in code, you can adjust them with sliders in the Glassmorphism Card Generator, watch the live preview, and copy the finished CSS right away.

See it in action with our tool.

Glassmorphism Card Generator

Dial in the frosted-glass blur strength, transparency, and border highlight you want in real time, then copy an optimized glassmorphism CSS stylesheet.

Where things usually get stuck in real projects

SituationCause and fix
No blur in older Safari or iOSIf you declare only backdrop-filter without the -webkit-backdrop-filter prefix, the effect can be dropped in older Safari. Include both properties to safely cover a wider range of versions.
The card is just blurry and doesn't feel like glassbackdrop-filter blurs what's behind the card, so the effect only shows up when there's something vivid back there, like a gradient or an image.
Text on the semi-transparent background is hard to readText contrast shifts with the background color, so pair white text with a dark background and dark text with a light background.

Wrap-up

A glassmorphism card is built from a combination of four CSS properties: background blur, a semi-transparent background color, a border highlight, and a shadow. Rather than plugging values into code and refreshing to check them, you can adjust sliders with a live preview and find the glass look you want faster. To support a wide range down to older Safari and iOS, get in the habit of including the -webkit- prefix as well.

Glassmorphism Card Generator

Dial in the frosted-glass blur strength, transparency, and border highlight you want in real time, then copy an optimized glassmorphism CSS stylesheet.

Frequently asked questions

Which browsers do the generated CSS work well in?

It works in current versions of Chrome, Edge, Safari, and Firefox that support backdrop-filter. The -webkit-backdrop-filter prefix is generated too, for Safari.

My card only looks blurry and doesn't feel like glass.

backdrop-filter blurs what's behind the card, so the glass feel only comes through when there's a vivid background with color or an image behind it.

Can I use the generated CSS as-is in a real project?

Yes. You can freely use the CSS you copy in your project with no license attribution required.

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. CSS gradient text shows as a square? Use background-clip: textA background gradient fills the whole box, not your letters. Here's why it happens and how background-clip: text with a transparent text color fixes it.
  2. Find a Color Name From a HEX: Why You Get Several MatchesEnter a HEX value and see the closest CSS color names among the 148 standard names, how redmean distance works, and why the ranking can shift.
  3. HEX vs RGB vs HSL: Why the Same Color Has Three Codes#3B82F6, rgb(59, 130, 246), and hsl(217, 91%, 60%) are the same color. Here's what each notation means, how to convert by hand, and what HEX alpha does.
  4. Mesh gradient overlap order: which color shows on topWhen two mesh gradient color points overlap, CSS layer order decides which color you see. Here's how background-image stacking works, and how to check it.
  5. iOS vs Android Tab Bars: Why They Differ and How to Build OneSee why iOS and Android tab bars look different, then pick the style you want and copy the HTML and CSS straight into your project.
  6. Bottom tab bar CSS: fix safe-area-inset-bottom on mobileBuild a fixed bottom tab bar for mobile web apps, handle iPhone safe-area-inset-bottom, and design tab styles on screen, then copy the HTML/CSS.

Related tools