CSS Box Shadow Generator
Design a CSS box shadow with sliders, stack several layers, and copy the code.
Preview
Presets
How to use the Box Shadow Generator
- Adjust the shadowMove the sliders for offset, blur, spread and opacity, and pick a color. Tick Inset for an inner shadow.
- Stack layersAdd up to six layers for softer, more realistic depth, or start from a preset.
- Copy the CSSPress Copy CSS and paste the box-shadow line into your stylesheet.
Example
The default soft shadow is box-shadow: 0px 10px 30px -5px rgba(16, 24, 40, 0.25);
The Layered preset stacks three faint shadows of growing size, which looks more natural than one dark shadow.
Frequently asked questions
What do the four box-shadow numbers mean?
In order: horizontal offset, vertical offset, blur radius and spread. Positive offsets move the shadow right and down. Blur softens the edge, and spread makes the shadow bigger or, if negative, smaller than the box.
How do I make a shadow look natural?
Use low opacity (10–25%), a large blur, a small negative spread, and a downward Y offset. Stacking two or three such layers looks even more realistic.
What is an inset shadow?
With inset, the shadow is drawn inside the box instead of outside, which makes it look pressed in. It is often used for input fields and buttons.
Does box-shadow affect layout or performance?
No, it does not change the size or position of anything. Very large blurs on many elements can slow down scrolling on older phones, so use them sparingly.