CSS Box Shadow Generator

Stack several shadow layers, tune offset, blur, spread, color and opacity, and see the result on a live card before copying the box-shadow CSS.

Loading tool…

About the Box Shadow Generator

The box-shadow syntax is [inset] x-offset y-offset blur spread color. Positive x moves the shadow right and positive y moves it down. Blur softens the edge (it cannot be negative), and spread grows or shrinks the shadow before blurring. A negative spread combined with a large blur is the usual trick for soft shadows that do not leak out the sides.

Several shadows can be combined with commas; the first one is drawn on top. Realistic elevation usually pairs a tight, darker shadow for contact (0 2px 6px) with a wide, faint one for ambient light (0 10px 30px -8px). Using a dark, slightly tinted color at low opacity looks more natural than pure black.

inset draws the shadow inside the border for pressed buttons or wells. Box shadows follow border-radius and do not affect layout. For shadows that follow transparent PNG shapes, use filter: drop-shadow() instead. Test the result on both light and dark page colors, since a shadow that reads well on white often disappears on a dark theme.

How to use it

  1. Select a layer or add a new one.
  2. Move the sliders for offset, blur, spread and opacity, and pick a color.
  3. Tick Inset for an inner shadow.
  4. Change page and box colors or border radius to test the look.
  5. Copy the generated CSS.

Frequently asked questions

What is the difference between blur and spread?
Blur controls how soft the edge is; spread changes the shadow's size before blurring. Spread can be negative to make the shadow smaller than the element.
Does box-shadow hurt performance?
Static shadows are cheap. Animating large blurred shadows can be costly; animate the opacity of a pseudo-element that carries the shadow instead.
How do I add a shadow on one side only?
Offset in that direction and use a negative spread equal to the blur, e.g. 0 8px 6px -6px rgba(0,0,0,.4) for a bottom-only shadow.
box-shadow or filter: drop-shadow?
box-shadow follows the element's box and border-radius and supports spread and inset. drop-shadow follows the alpha shape of the content, such as a transparent PNG or SVG icon.

Related tools