Skip to content

Glassmorphism CSS Generator (Frosted Glass)

Create a frosted glass effect with CSS: adjust blur, transparency, saturation, border and radius over colorful backgrounds and copy backdrop-filter CSS that works in every modern browser.

Glass card
$24,580.00
Frosted glass effect with backdrop-filter
Background

CSS code

How to create a glassmorphism effect

  1. Pick a background. Glass only looks like glass when there is something colorful behind it.
  2. Adjust blur to frost the background and transparency to control how much color shows through.
  3. Raise saturation to make the colors behind the glass richer, and add a thin light border to catch the edge.
  4. Copy the CSS and apply the .glass class to a card, navbar or dialog.

How the CSS works

  • background: rgba(255, 255, 255, 0.2) makes the element semi-transparent.
  • backdrop-filter: blur(12px) saturate(160%) blurs and boosts whatever is behind the element, not the element itself.
  • -webkit-backdrop-filter is still needed for Safari.
  • A 1px semi-transparent white border and a soft shadow separate the panel from the background.

Accessibility and performance tips

  • Text on glass changes contrast as the background moves. Keep the panel opaque enough and check the result with the contrast checker against the lightest and darkest area behind it.
  • Backdrop filters are GPU work. Use them on a few large surfaces, not on hundreds of list items, and avoid animating the blur.
  • Provide a fallback background for users who turn on reduced transparency: @media (prefers-reduced-transparency: reduce).
  • A dark glass (black at 20–40%) works well for overlays and media controls; a light glass suits cards and navbars.

Pair the effect with gradients from the CSS gradient generator and soft shadows from the box shadow generator.

More CSS tools