CSS Box Shadow Generator - Create CSS Box Shadows Visually

Fine-tune depth, soft card elevation, or inset borders visually without guessing pixel numbers. Layer multiple shadows, control horizontal and vertical offsets, blur, spread, opacity, and copy clean CSS in one click.

CSS Box Shadow Generator

How to use the CSS Box Shadow Generator

  1. 1Watch the Preview Card update live as you adjust the X (-60 to 60px), Y (-60 to 60px), Blur (0 to 100px), Spread (-40 to 40px), and Opacity (0 to 1) sliders on Layer 1.
  2. 2Select a shadow color via the Color picker and check Inset if you want the shadow rendered inside the card border.
  3. 3Click Add Layer whenever you want to combine multiple soft ambient and key shadow layers together, or click Remove to drop extra layers.
  4. 4Click Copy inside the dark CSS code bar at the bottom to copy the complete box-shadow rule.

What the CSS Box Shadow Generator does

The visual generator combines multiple shadow layers on a live Preview Card and outputs copy-ready CSS in your browser:

  • Supports stacking multiple independent shadow layers and joins them into one comma-separated CSS box-shadow declaration.
  • Provides exact sliders per layer for horizontal offset X, vertical offset Y, blur radius, spread radius, opacity, color picker, and Inset checkbox.
  • Converts each layer hex color and alpha opacity slider into clean rgba(r, g, b, alpha) syntax for predictable browser rendering.
  • Allows removing any extra layer (while keeping at least one active layer) and provides a one-click Copy button.

Example

Default shadow layer settings
X: 0px | Y: 12px | Blur: 28px | Spread: -4px | Color: #150d28 | Opacity: 0.18 | Inset: off
Generated CSS box-shadow rule
box-shadow: 0px 12px 28px -4px rgba(21, 13, 40, 0.18);

Using a negative spread (-4px) pulls the shadow footprint slightly inward so the soft 28px blur concentrates below the bottom edge of the Preview Card.

Frequently asked questions

What is the difference between blur and spread in box-shadow?

Blur controls how soft or feathered the shadow edge becomes (larger values make the edge wider and softer). Spread expands or shrinks the size of the solid shadow rectangle evenly on all sides before blur is applied—negative spread pulls the shadow inward.

How do I create an inner shadow?

Check the Inset box on any shadow layer. Adding the inset keyword in CSS draws the shadow inside the element border instead of outside.

Can I stack multiple box shadows on one element?

Yes. Click Add Layer to create additional layers. The generator joins all layers with commas inside a single valid CSS box-shadow declaration.

Why does the output CSS use rgba() for the shadow color?

Converting your chosen hex color and Opacity slider into rgba(r, g, b, alpha) ensures subtle translucent shadows work consistently across browsers.

Related tools

View All Tools