CSS Box Shadow Generator
Build soft, layered or inner CSS box shadows with live sliders and presets, then copy the box-shadow CSS.
Runs in your browser. Nothing is uploaded.
How to use the CSS Box Shadow Generator
- Start from a preset, such as Soft card, Floating, Sharp, Inner or Glow, or edit the first layer.
- For each layer, set the offset across and down, blur, spread, colour and opacity, and tick Inner shadow for an inset shadow.
- Press Add a layer to stack shadows for a more natural look.
- Change the page colour, box colour and corner radius to preview it in your design.
- Copy the box-shadow CSS.
Shadows that look right
Shadows give interfaces depth: they lift cards off the page, show which element is in front and draw attention to buttons and menus. A shadow that is too dark, too hard or the wrong colour, though, makes a design look dated. The trick used in many modern interfaces is to combine several soft, low-opacity layers. This generator makes that easy to experiment with.
Every part of a shadow
Each layer has the same settings the CSS box-shadow property has:
- Across and down: how far the shadow is offset. Light usually comes from above, so a positive down value looks natural.
- Blur: how soft the edge is.
- Spread: grows the shadow, or shrinks it with a negative value.
- Colour and opacity: a dark blue-grey at low opacity often looks better than pure black.
- Inner shadow: draws the shadow inside the box.
Layered shadows
Add layers to build realistic elevation: a small, slightly darker shadow close to the box and a larger, very soft one further out. The presets show common recipes, from a subtle card to a floating dialog, a sharp retro offset, an inset field and a coloured glow.
Preview in context
Shadows look different on different backgrounds, so you can change the page colour, the box colour and the corner radius. A shadow that is clear on light grey may vanish on white or turn into a dark smudge on a coloured background.
Clean CSS
The output is a single box-shadow declaration with one line per layer, using modern
rgb(r g b / alpha) colours. It works in every current browser. Pair it with the
Border Radius Generator and the
CSS Gradient Generator to style complete components. Everything runs in your browser.
Frequently asked questions
What do blur and spread do?
Blur softens the edge of the shadow; 0 gives a hard edge. Spread grows or shrinks the shadow before blurring; a negative spread keeps a big blur from showing at the sides, which looks more natural.
Why use more than one layer?
Real shadows have a dark, tight part close to the object and a soft, wide part further away. Two or three layers, one small and one large, mimic that and look far more realistic than a single heavy shadow.
What is an inner shadow?
An inset shadow is drawn inside the box instead of outside, making it look pressed in. It is often used for input fields and toggle tracks.
Do shadows slow down a page?
Static shadows are cheap. Animating large blurred shadows can be heavy on low-end phones; animate the opacity of a pseudo-element with the shadow instead.
Is anything uploaded?
No. Everything runs in your browser.
Tutorials
How to create realistic layered shadows for cards
Build a three-layer box shadow that makes cards look naturally lifted, then add a stronger version for hover with a smooth transition.