CSS and Colour tool

Glassmorphism Generator: Frosted Glass CSS

Make a frosted glass effect in CSS. Set blur, transparency, saturation, border and radius, then copy CSS with the Safari prefix and a fallback.

Last updated

A glassmorphism generator builds the CSS for a frosted glass panel: a see-through background with the page behind it blurred. Set the blur, transparency, saturation, border and corner radius, try it over different backgrounds, and copy CSS with the Safari prefix and a solid fallback included.

Background

Presets

The tint is also the border colour. Transparency sets how much of it shows.

Browser support

backdrop-filter works in Chrome, Edge, Firefox 103+ and Safari (which needs the -webkit- prefix before Safari 18). Internet Explorer and older Firefox have no blur, so the CSS ends with a solid background for them.

CSS

.glass {
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
}

/* No backdrop-filter support: a solid background keeps text readable. */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .glass {
    background: rgb(255, 255, 255);
  }
}

Everything runs in your browser. Nothing you make is uploaded.

How to use it

  1. Start from a preset. Frosted is the classic look, Clear and Heavy frost are lighter and stronger versions of it, Dark is for dark pages, and Pink tint shows a coloured glass.
  2. Pick a background. Glass only looks like glass over something with detail. Stripes shows the blur most clearly; the gradients are the presets from the CSS Gradient Generator.
  3. Tune it. Blur sets how frosted the glass is, Transparency how much of the tint shows, Saturation how vivid the colours behind it stay, and Radius rounds the corners. Border and Border opacity draw the light edge that makes the panel read as a sheet of glass.
  4. Change the tint. Type any CSS colour, such as #ffffff, navy or rgb(17 24 39), or use the picker. The border uses the same colour.
  5. Copy CSS. The rule under the controls is ready to paste. Rename .glass to your own class.

Everything runs in your browser. Nothing you make is uploaded.

The CSS behind it

.glass {
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
}
 
/* No backdrop-filter support: a solid background keeps text readable. */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .glass {
    background: rgb(255, 255, 255);
  }
}
  • background is the tint. It has to be see-through, or there is nothing behind it to blur. 10% to 40% opacity is the usual range.
  • backdrop-filter filters whatever is painted behind the element. blur() does the frosting and saturate() stops the blur washing the colours out. It takes the same functions as filter, so brightness() and contrast() work too.
  • -webkit-backdrop-filter is the same thing for Safari, which only understood the prefixed name until Safari 18. It goes first, so a browser that reads both uses the standard one.
  • border is the light edge. A 1px line in the tint colour at low opacity catches the eye the way the edge of real glass does.

Browser support and the fallback

backdrop-filter works in Chrome 76+, Edge 79+, Firefox 103+, Opera, Samsung Internet, and Safari 9+ with the -webkit- prefix. It does not work in Internet Explorer, in Firefox before 103, or in Opera Mini.

Without the blur, a 20% white panel over a busy background is just a faint wash, and any text on it can become unreadable. That is why the output ends with an @supports not (...) block: a browser that supports neither spelling of backdrop-filter gets the tint as a solid colour instead. It looks plainer, but the text stays readable. Check your text colour against that solid background too with the Contrast Checker.

Gotchas

  • It needs something behind it. Over a flat colour, blurred and unblurred look the same. Put glass over an image, a gradient or shapes.
  • Readability is on you. Glass over a busy photo can drop text contrast below what WCAG allows. Raise the opacity, add more blur, or put a darker tint behind light text.
  • Stacking matters. The backdrop is what is painted behind the element within its stacking context. A parent with its own filter, opacity below 1 or backdrop-filter changes what gets blurred.
  • It costs performance. Every frame, the browser blurs the area under each glass element. A few panels are fine; dozens of them, or a large blur on a scrolling page, can drop frames on a phone.
  • Depth comes from a shadow. Glass panels usually float over the page with a soft shadow. Build one with the Box Shadow Generator and add it to the same rule.

Keep going

The CSS Gradient Generator makes the background glass looks best on, and the Box Shadow Generator gives it depth. The Color Converter turns the tint into any format, and the CSS cheat sheet covers the properties around it. More free tools that run in your browser are on the tools page.

Common questions

How do I make a glassmorphism effect in CSS?

Give the element a see-through background, such as rgba(255, 255, 255, 0.2), and blur what is behind it with backdrop-filter: blur(12px). A thin light border and rounded corners finish the frosted glass look. This glassmorphism generator builds the whole rule for you, including the Safari prefix and a fallback: move the sliders, watch the panel, and copy the CSS.

What is the difference between backdrop-filter and filter?

filter changes the element itself and everything inside it, so filter: blur() blurs your text too. backdrop-filter changes only what shows through behind the element, which is what frosted glass needs: the page behind is blurred and the text on the glass stays sharp. backdrop-filter only shows when the element's own background is at least partly transparent.

Why is my backdrop filter not working?

The usual causes are a background that is fully opaque (nothing shows through to blur), nothing interesting behind the element (blurring a flat colour looks the same), a missing -webkit-backdrop-filter line for Safari before version 18, or a browser with no support at all, such as Firefox before 103. An ancestor with its own backdrop-filter, filter or opacity can also change what counts as the backdrop.

Which browsers support backdrop-filter?

Chrome and Edge since 76 and 79, Firefox since 103, Opera, Samsung Internet, and Safari since 9 with the -webkit- prefix. Safari 18 added the unprefixed name, so both lines are still worth writing. Internet Explorer never supported it. The CSS from this tool includes an @supports block that gives those browsers a solid background instead.

What does saturate do in a glass effect?

saturate() inside backdrop-filter makes the colours behind the glass more vivid. Blur on its own tends to wash colours out into grey, so a saturation above 100%, often 150% to 180%, keeps the glass looking bright. 100% leaves the colours as they are, and 0% turns the backdrop grey.

Is anything I make sent to a server?

No. The glass panel is built and previewed in your browser and its values are never submitted anywhere. The site records that the tool was used and which preset or background was picked, so we know which tools are worth building next. Your values and colours are never part of that.

See all tools

Want this explained by a cat?

The videos cover the same ground in sixty seconds. If there is a tool you want built next, ask.