Skip to content
Guest
Learn CSS · Course Syllabus Show lessons
Visual Polish & Motion · 8 min read · Beginner

Gradients, Layered Shadows & Backdrop Filters

Add visual depth with linear/radial gradients, realistic multi-layered box-shadows, and frosted-glass backdrop-filter surfaces.

What you'll learn

  • Create smooth linear and radial CSS gradients without image files
  • Combine subtle ambient and direct box-shadows for realistic elevation
  • Build frosted-glass sticky surfaces using backdrop-filter: blur()

Depth and surface separation guide the user’s eye. Modern CSS lets you craft crisp surfaces (gradients, soft elevation shadows, and frosted glass)with zero image assets.

Realistic Layered Shadows

A single harsh black shadow (0 4px 10px black) looks dated. Pair a tight low-opacity shadow with a soft diffused shadow:

.elevated {
  box-shadow:
    0 1px 2px rgb(15 23 42 / 0.06),
    0 12px 24px -4px rgb(15 23 42 / 0.12);
}

Fill-in-the-Blank Exercise

Frosted Glass Surface

Create a diagonal gradient background and a frosted-glass blur overlay.

.banner {
background: (135deg, #2563eb, #7c3aed);
}
.glass {
background: rgb(255 255 255 / 0.8);
: blur(8px);
}

Try It Yourself

Tweak the gradient angle, shadow softness, or backdrop-filter blur radius below:

Gradient Hero + Frosted Glass Card
Live Result

Check Your Understanding

Score: 0 / 1

1. Which CSS property blurs the content *behind* a semi-transparent element?

Study Workspace

Finished this lesson?

Your progress is saved locally in your browser, no account needed.

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind