CSS Box Shadow Generator: Live Preview

Use this css box shadow generator to design shadows without guessing. Drag sliders for offset, blur, spread and opacity, pick a color, add inset or layered shadows, and see a live preview. Copy the ready CSS for your project.

CSS Box Shadow Generator

Soft, hard and inset shadows.

Everything runs in your browser. Nothing you enter or upload is sent to a server.

How to use the CSS Box Shadow Generator

  1. Drag the sliders to shape the shadow.
  2. Pick the shadow color and opacity.
  3. Tick Inset for an inner shadow.
  4. Copy the CSS.

How it works

The box-shadow property takes a horizontal offset, vertical offset, blur radius, spread radius and color. Positive offsets move the shadow right and down; blur softens it; spread grows or shrinks it; inset puts it inside the box.

Example

box-shadow: 10px 10px 20px 0px rgba(0, 0, 0, 0.3); gives a soft shadow below and to the right.

Frequently asked questions

What is a good subtle shadow?

Try 0 4px 12px rgba(0,0,0,0.1).

Can I add more than one shadow?

Yes, separate several shadows with commas in the same property.

Does box-shadow affect layout?

No. Shadows do not take up space.

See also: Color Picker.

Design a box shadow

How to use it

  1. Set offset and blur.
  2. Adjust spread and color.
  3. Add more layers if you like.
  4. Copy the CSS.

More questions

Can I stack shadows?

Yes. Add several shadow layers to build soft, layered effects.

What does inset do?

Inset puts the shadow inside the box, so it looks pressed in.

Does it work in all browsers?

Yes. Box shadow works in all modern browsers, including Chrome, Safari, Firefox and Edge.

Related tools: CSS Gradient Generator, HEX to RGB Converter, CSS Minifier and Beautifier.

A soft card shadow

Move the sliders for offset, blur, spread, opacity and radius, pick the colors, then copy the CSS. To check that text stays readable on a shadowed card, use the Color Contrast Checker.

Worked example: offsets of 4 px and 8 px, a 16 px blur, 0 spread and 25% black give box-shadow: 4px 8px 16px 0px rgba(0, 0, 0, 0.25); with a 12 px radius. A subtler card shadow uses 0, 2 px, 6 px and 0.1 opacity.

More answers

What do the four length values in box-shadow mean?

They are the horizontal offset, the vertical offset, the blur and the spread. In 4px 8px 16px 0px, the shadow sits 4 px right, 8 px down, blurs over 16 px and has no spread.

What does the 0.25 in rgba mean?

It is the opacity of the shadow color, so 0.25 is 25% black. Lower numbers such as 0.1 give a lighter, more subtle shadow.