How to use the CSS Glassmorphism Generator
- Adjust the blur radius to control how strongly the background is softened behind the card.
- Set the glass opacity and tint colour. Lower opacity shows more of the background.
- Adjust the border highlight and corner radius until the edge looks right on the background you will use.
- Copy the generated CSS into your stylesheet.
How it works
The effect relies on the CSS backdrop-filter property, which blurs whatever is behind an element. The card itself gets a semi-transparent background colour so the blurred backdrop shows through, plus a light border and soft shadow to separate it from the page.
The output includes the -webkit-backdrop-filter prefix, which Safari still needs.
background: rgba(R, G, B, opacity);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 20px;Worked example: a glass card over a photo
With 16 px blur and 45% opacity, text on the card stays readable over a busy photograph because detail behind it is softened and partly covered.
With very low opacity and little blur, the card becomes almost invisible over a plain background. Glass effects need something colourful or detailed behind them to look like glass.
Limitations
- Text contrast changes with whatever is behind the card. Check that text meets WCAG contrast over the busiest part of the background.
- backdrop-filter is costly to render. Many large glass elements, especially during scrolling, can make low-end phones slow.
- Browsers without backdrop-filter support show only the semi-transparent colour, so keep opacity high enough for the content to be readable without blur.
Frequently asked questions
What is glassmorphism?
A visual style where interface panels look like frosted glass: translucent, blurred backgrounds with a subtle border, layered over colourful content.
Does backdrop-filter work in all browsers?
It works in current versions of Chrome, Edge, Firefox, and Safari. Safari requires the -webkit- prefix, which the generated CSS includes.
Why doesn't my glass effect show?
The element needs something behind it to blur, and its own background must be partly transparent. A solid background colour on the element hides the effect.
Is glassmorphism accessible?
It can be, if text contrast stays high. Use a higher opacity tint behind text and test against the actual background.