Drag the sliders, pick a color, preview the box-shadow live and copy the CSS in one click.
A CSS shadow is written in this order:
box-shadow: offset-x offset-y blur spread color inset;
| Value | What it does |
|---|---|
| offset-x / offset-y | How far the shadow sits from the element. Positive x moves right, positive y moves down. |
| blur | Softness. 0 gives a hard edge; larger values fade the shadow out. |
| spread | Grows or shrinks the shadow before blurring. Negative values tighten it. |
| color | Almost always semi-transparent black — rgba(0,0,0,.1) and friends. |
| inset | Draws the shadow inside the element instead of behind it. |
A single shadow usually looks flat. Layering two or three — a tight one for the contact edge and a wide soft one for the ambient bleed — reads as a real object lifting off the page:
0 1px 2px rgba(0,0,0,.06)0 8px 24px rgba(0,0,0,.10)Direction matters as well. Shadow offsets should agree with the rest of the interface: if highlights come from above, shadows fall below.
Adding the inset keyword moves the shadow inside the box, which is the standard trick for pressed buttons, recessed input fields and progress tracks. Note that an inset shadow is painted above the background but below the content, so text stays readable.
transform or opacity instead lets the compositor take over.