CSS Box Shadow Generator

Design and preview CSS box shadows in real time. Adjust offset, blur, spread, color, and opacity — then copy the ready-to-use CSS instantly.

Shadow Settings

10px
10px
15px
0px
0.3
Generated CSS
box-shadow: 10px 10px 15px 0px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 10px 10px 15px 0px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 10px 10px 15px 0px rgba(0, 0, 0, 0.3);
Share this tool:

Understanding CSS Box Shadows

The box-shadow property attaches one or more drop shadows to an element's box. It is one of the most powerful CSS tools for creating depth, elevation, and visual hierarchy — fundamental to modern UI design systems like Material Design and Apple's Human Interface Guidelines.

You can layer multiple shadows by separating them with commas, allowing designers to create nuanced, realistic lighting effects that a single shadow can't achieve.

Syntax Breakdown

10px — Horizontal Offset (X)
10px — Vertical Offset (Y)
15px — Blur Radius
0px — Spread Radius
rgba(0,0,0,0.3) — Color & Opacity
inset — (optional) Inner shadow

The Inset Effect

Adding the inset keyword renders the shadow inside the element's border, creating a "sunken" or "pressed" appearance. This is ideal for active button states, depth-indication in card headers, and input fields that appear recessed into the UI.

Blur vs Spread

Blur radius softens the shadow's edge — higher values produce a softer, wider glow; zero produces a hard-edged silhouette. Spread radius physically expands or contracts the shadow's size before the blur is applied.

Browser Prefixes

All modern browsers support the unprefixed box-shadow. The -webkit- prefix targets very old Safari/Chrome and -moz- targets Firefox 3.5. Our generator includes them automatically for maximum legacy coverage.

Tips for Realistic Shadows

Real-world shadows are rarely pure black — they pick up the ambient colour of the environment. Try using a very dark, slightly tinted version of your background colour instead of #000000. Keep opacity low (0.1–0.25), use a moderate blur (10–30px), and nudge the Y offset slightly more than X to simulate a light source from above. Layering two shadows — one tight and dark, one wide and soft — produces dramatically more convincing results than a single shadow layer.

Frequently Asked Questions

Was this tool helpful?

Comments

Loading comments...

Check Out Other Popular Tools