CSS box-shadow generator
Build layered CSS box shadows with sliders: offset, blur, spread, colour, opacity and inset.
Runs entirely in your browser. Your files never leave your device.
About this tool
A good shadow makes a card float, a button look pressable and a modal stand out from the page. The softest, most realistic shadows are made of several layers: a tight one close to the element and a wide, faint one further away. Start from a preset, soft, layered, hard offset, glow or inner, and tune each layer with sliders while the preview updates.
Every layer has its own horizontal and vertical offset, blur, spread, colour and opacity, and can be turned into an inset shadow for pressed or engraved effects. Change the box colour, page background and corner radius to see the shadow in context, then copy the box-shadow declaration or share it as a link.
How it works
- Pick a preset.
- Adjust the layers, or add up to six.
- Set the box colour, background and corner radius for the preview.
- Copy the CSS.
Colours are written as rgba() so opacity is part of each shadow. Layers listed first are drawn on top.
Worked example
A soft card shadow made of two layers: 0 1px 2px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.12). The tight layer defines the edge, the wide faint one gives the impression of height.
For a pressed button, switch one layer to inset with a small offset: inset 0 2px 4px rgba(0,0,0,0.2).
Good to know
- Shadows look more natural when they fall slightly downward, as if lit from above.
- On dark backgrounds, shadows barely show; use a lighter border or a subtle glow instead.
- Animate opacity or transform rather than the shadow itself for smoother hover effects.