css box shadow generator

Smooth CSS Box Shadow Generator

A single shadow looks flat. Stack two or three layers — a tight dark shadow close to the edge, a soft wide one further out — and you get the smooth, realistic 3D depth used in real interfaces.

preview.html
controls
shadow-box.css

          

Why layered box shadows look more realistic

A single css box shadow tool call reads as flat because real light casts more than one edge: a crisp, close, dark shadow where the object nearly touches the surface, and a soft, wide, faint one where light wraps around it. Combining both is the layered box shadow css technique behind most modern card and button depth.

Using the css smooth drop shadow tool

Set your first layer tight and dark, click "Add layered shadow" for a second pass with a larger blur and lower opacity, and the generator combines every layer into one comma-separated box-shadow declaration ready to paste.

Worked example: one soft, tucked-in shadow

The default shadow is a single violet layer with a negative spread:

default output
.shadow-box {
  box-shadow: 0px 10px 24px -6px rgba(167, 139, 250, 0.45);
}

The negative spread is what keeps it looking like lift instead of a glow. Blur alone makes a shadow spill past the sides of the box. Pulling the shadow in by 6px first means the blurred edge stays mostly underneath, so it reads as the box floating slightly above the page. Set spread to 0 and compare the two to see the difference.

For more depth, box-shadow accepts a comma-separated list. The first shadow in the list is painted on top, so put the tightest, darkest layer first and the widest, faintest one last.

Anatomy of the default value

PartValueWhat it does
x-offset0pxNo sideways shift. Positive values move the shadow right, negative left.
y-offset10pxPushes the shadow 10px down, as if the light were above. Negative values move it up.
blur radius24pxHow far the edge is softened. Larger is softer and fainter.
spread-6pxShrinks the shadow by 6px on every side before the blur is applied.
colorrgba(167, 139, 250, 0.45)The violet #a78bfa at 45% opacity.

Frequently asked questions

How many shadow layers should I actually use?

Two is usually enough — a tight, dark shadow close to the object and a soft, wide, low-opacity one further out. Three can add extra realism for elevated cards, but beyond that the effect stops reading as more 'realistic' and just adds render cost.

Why does my box-shadow look muddy instead of soft?

That's usually opacity set too high on a wide-blur layer. A large blur radius with strong opacity reads as a smudge rather than a soft shadow — drop the opacity on your widest layer well below your tightest one.

What's the difference between blur and spread?

Blur radius softens and widens the shadow's edge. Spread grows or shrinks the shadow's shape itself before blur is applied — a negative spread with a large blur is the classic combination for a soft, receded drop shadow.

Does box-shadow affect layout or accessibility?

No — box-shadow is purely visual and doesn't affect the element's size or take up layout space, unlike a border. It also doesn't need any special accessibility treatment since it's decorative by nature.

Also by the creator clukr.com Hatch it. Read it. Gone. Encrypted in your browser. Read once, then it's erased. No recipient account needed.
Copied!