Design & CSS Tools

CSS Box Shadow Generator

Build CSS box-shadow effects visually and copy the code.

What is a box shadow?

The CSS box-shadow property draws a shadow around an element such as a card, button, image or popup. Shadows add depth and help users see which parts of a page sit "above" others. A soft, subtle shadow is one of the simplest ways to make a design look modern and polished.

How to use the generator

  1. Move the horizontal and vertical offset sliders to set where the shadow falls. Positive values move it right and down.
  2. Increase blur for a softer edge and adjust spread to make the shadow larger or smaller than the box.
  3. Choose the shadow color and opacity. Low opacity (10 to 30 percent) looks most natural.
  4. Tick Inset for an inner shadow that makes the element look pressed in.
  5. Copy the CSS code.

The box-shadow syntax

box-shadow: [inset] offset-x offset-y blur spread color;

Popular shadow styles

StyleCSS
Subtle card0 1px 3px rgba(0,0,0,0.12)
Floating card0 10px 25px -5px rgba(0,0,0,0.25)
Sharp retro6px 6px 0 0 rgba(0,0,0,1)
Inner fieldinset 0 2px 4px rgba(0,0,0,0.1)

Frequently asked questions

Can I add more than one shadow?

Yes. Separate shadows with commas, for example a small sharp shadow plus a large soft one. Layered shadows often look more realistic.

Do shadows slow down a website?

Static shadows are cheap to draw. Animating large blurred shadows can be slow on older phones, so animate opacity instead.

What about shadows on text?

Text uses a different property, text-shadow, which has no spread and no inset option.