Back to Snippets
CSS / TailwindCSS

CSS Glass Morphism Effect

A frosted glass effect using backdrop-filter for modern UI cards.

cssglassblurbackdrop
.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

text-emerald-400">"text-gray">/* Dark variant */
.glass-card-dark {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
}

How to Use

Apply the .glass-card class to any container element. Place it over a colorful or image background for the best effect. The -webkit-backdrop-filter prefix ensures Safari compatibility.

Related Technology

Tailwind CSS

Have a Project in Mind?

Let's discuss how we can bring your idea to life. From initial concept to production-ready product — we've got you covered.

or book a free call