How to use the box shadow generator
- Move the sliders to set the shadow's horizontal and vertical offset, blur, spread and opacity.
- Add more layers for natural-looking depth. Real shadows are usually a sharp, close shadow plus a soft, wide one.
- Change the box and background colors to match your design, then copy the CSS.
For a quick start, pick a preset such as Soft, Layered, Floating or Glow and adjust it. You can also round the box's corners to see how the shadow looks on a card or a button.
What each value does
- Offset X / Y: moves the shadow right/down (positive) or left/up (negative).
- Blur: how soft the edge is. 0 gives a hard edge.
- Spread: grows or shrinks the shadow before blurring. Negative spread with a big blur gives a soft, "floating" look.
- Inset: draws the shadow inside the box, like a pressed button.
Shadow ideas
- Cards: two faint layers, a small sharp one and a larger soft one, at 5–10% opacity each.
- Pop-ups and menus: a large blur with negative spread, so the panel seems to float above the page.
- Input fields: a light inset shadow makes a box look sunk into the page.
- Focus and highlight: a colored shadow with no offset works as a soft glow around a button.
FAQ
Do box shadows slow down a page?
Not noticeably in modern browsers. Very large blurs on many elements that animate can cost performance; for animations, consider animating opacity of a shadow layer instead.
How do I make a shadow follow an image's shape?
Box shadows follow the element's box. For transparent PNGs, use filter: drop-shadow(…) instead.
Why does my shadow look gray and dirty?
Usually because it is pure black at high opacity. Real shadows are faint: keep the opacity low and try a dark shade of your background color instead of black.
Can I add a shadow to text?
Use text-shadow. It takes the same offset, blur and color values, but no spread or inset.