About the CSS Box Shadow Generator
Getting a box shadow to look right by editing numbers is slow. This generator gives you sliders for horizontal and vertical offset, blur, spread, color and opacity with a live preview.
Stack multiple shadow layers, try presets and copy the CSS straight into your stylesheet.
How to use the CSS Box Shadow Generator
- Adjust offset, blur and spread with the sliders.
- Choose shadow color and opacity, and toggle inset if needed.
- Add more layers or try a preset.
- Copy the generated CSS.
Key features
- Live preview
- Multiple shadow layers
- Inset shadows
- Copy-ready CSS
Designing realistic shadows
Natural shadows are soft and slightly offset downward, as if light comes from above. A small vertical offset, a large blur and low opacity, such as 0 4px 12px rgba(0,0,0,0.08), gives a subtle card shadow. Stacking two layers, one tight and dark and one wide and faint, creates the layered depth used by many modern design systems.
Spread grows or shrinks the shadow before blurring, and inset draws the shadow inside the element, which is useful for pressed buttons and input fields.
Common uses
- Styling cards, buttons, dropdowns and modals.
- Creating elevation levels for a design system.
- Designing pressed and focus states with inset shadows.
- Building neumorphic or glowing effects.
Tips for the best results
- Use a tinted shadow color based on your background instead of pure black.
- Keep shadows consistent across the interface to show the same elevation.
- Increase blur and reduce opacity together for a softer, more modern shadow instead of a hard dark edge.
Frequently asked questions
What is spread in box-shadow?
Spread grows or shrinks the shadow's size before blur is applied.
How do I make a soft shadow?
Use a large blur, small offset and a low-opacity dark color.
Do I need vendor prefixes?
No. box-shadow is supported without prefixes in all modern browsers.
Do box shadows slow down websites?
Static shadows are cheap. Animating large blurred shadows can be heavy, so animate opacity on a pseudo-element instead.
Can I use the shadow on text?
This tool creates box-shadow for elements. Text uses the separate text-shadow property, which has no spread or inset values.