Tune a shadow with sliders, see it live and copy the box-shadow code. Layered and inset shadows included.
No sign-up, no fees.
CSS shadow generator: tune with sliders, see it live.
Layered shadows and inner shadow.
Soft, sharp, floating and inner presets.
Try it with background, box color and corner radius.
Copy the box-shadow code with one click.
How to use the CSS Box-Shadow Generator
Want your card to look slightly lifted from the page? Six steps:
Start from a preset. Pick Soft, Sharp, Floating or Inner under Presets; or carry on from the default.
Set the position. The Horizontal and Vertical sliders move the shadow; Blur softens the edge; Spread grows the shadow or (with a negative value) shrinks it.
Set the tone. Adjust the shadow's color with Color and Opacity. With Inner on, the shadow falls inside the box.
Add a layer (optional). Add a second and third shadow with Add layer; pick and tune each one separately from the Shadow layers list.
Try the preview. Change the Background, the Box color and the corner radius under Preview settings; these don't go into the code, they're only for trying.
Copy. Take the code below with Copy.
What is a box shadow?
Box shadow is the CSS feature that adds a shadow around an element. It separates cards, buttons, pop-ups and menus from the page and hints to the user what's clickable and what's in front. The "floating" look of modern interfaces comes largely from well-tuned shadows. Shadow code is made of a few numbers, but finding the right values takes trial and error; this tool makes it visual.
What do the values mean?
box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25); means horizontal offset, vertical offset, blur, spread and color, in that order. If inset comes first, it's an inner shadow. Multiple shadows are separated by commas and drawn on top of each other in order.
Tips for a nice CSS shadow
Light comes from above: keeping the vertical offset bigger than the horizontal looks natural.
Keep the opacity low: pure black and high opacity look harsh; 10-30% is enough for most interfaces.
Two layers: two layers, one close and sharp and one far and soft (like the "Floating" preset), are far more realistic than a single shadow.
Negative spread: keeps the shadow from spilling over the edges and makes it show only at the bottom.
Common mistakes
Giving everything a shadow: a shadow signals importance; if everything has one, nothing stands out.
A black shadow on a dark background: in dark themes, a slightly lighter box color separates better than a shadow.
No cost at all. Even the shadow's on us. Not bad, right?
Is anything I do saved?
The code is made in your browser. What you type is processed, but never shared with anyone.
Are box-shadow and text-shadow the same thing?
No. box-shadow falls around the box; text-shadow is used for a shadow on text, and it has no spread or inset.
Do shadows slow things down?
A few shadows are no problem. Constantly animating shadows with a very large blur can cause stutter on older phones.
What is the inner shadow for?
It makes the box look pressed in; it's used for pressed buttons and text boxes.
How are multiple shadows written?
Separated with commas, in one box-shadow line; for example one close, sharp shadow followed by one far, soft one. Use Add layer and the tool writes it for you.
Can I use it on my phone?
Yes. Adjust the sliders with your finger and take the code with Copy.
How big should the blur be?
As the vertical offset grows, grow the blur too; a blur about twice the offset is a good start. A small blur with a small offset looks like a sharp contact shadow.