Skip to content
AZ Tools

CSS Box Shadow Generator

Visually design CSS box-shadows with multiple layers, live preview, and copy-ready CSS / Tailwind output.

Presets

Shadow layers

Preview
CSS
box-shadow: 0px 8px 24px -4px rgba(0, 0, 0, 0.15), 0px 2px 6px -2px rgba(0, 0, 0, 0.08);
Tailwind
shadow-[0px_8px_24px_-4px_rgba(0,_0,_0,_0.15),_0px_2px_6px_-2px_rgba(0,_0,_0,_0.08)]

How to use

  1. Pick a preset or start from scratch.
  2. Tune each layer's offset, blur, spread, and color.
  3. Toggle inset for inner shadows.
  4. Copy the CSS rule or the Tailwind class.

About this tool

Show

Stack as many shadow layers as you like, tune the offset, blur, spread, colour and inset of each one, and watch the preview update as you go. Layering is where realistic depth comes from, and two rules explain most of it: shadows are painted in the order they are written, so the first layer in the list sits on top of the others, and a negative spread shrinks a shadow so it can be blurred generously without pooling out from under the element — which is exactly what a soft, believable shadow needs. Inset draws the shadow inside the border box instead, the basis of pressed buttons and the Inset preset. Six presets cover the common cases, and the output copies as a CSS rule or as a Tailwind arbitrary-value class.

Frequently asked questions

What's the difference between blur and spread?

Blur softens the shadow edge — the radius over which it fades to transparent. Spread expands or contracts the shadow shape itself before blurring (negative spread pulls it in).

When should I stack multiple layers?

Realistic shadows almost always need two: a tight, dark layer near the element + a wider, fainter layer further out. Compare Material Design or Tailwind's default shadows — most of them are multi-layer.

Why use rgba() instead of a HEX color?

Box shadows look more natural with translucent colors that let the background tint through. rgba() lets you set the alpha directly.

Why does Tailwind use underscores?

Tailwind splits class strings by whitespace, so arbitrary values use underscores in place of spaces.

Why do the default and several presets use a negative spread?

Because it is what stops a layered shadow reading as a halo. A blurred shadow spreads outwards in every direction, so with spread at 0 it peeks out above the element as much as below it and the result looks like a glow rather than something sitting on a surface. Pulling the spread negative shrinks the shape before the blur is applied, so the visible softness stays under and just below the element — which is why the default here is 0 8px 24px −4px over 0 2px 6px −2px rather than two plain blurs.

Does a box shadow affect layout or get clipped?

It never affects layout: the shadow is painted outside the border box and adds nothing to the element's width, height, or a parent's scrollable area — unlike a border. It is clipped, though. A parent with overflow: hidden, or a rounded card that crops its children, will cut the shadow off at the edge. If a shadow vanishes on one side only, look for the ancestor doing the clipping rather than adjusting the offsets.

Related tools