DevHive

CSS Box Shadow Generator

Visual CSS box-shadow builder with live preview

Layers
4px
4px
10px
0px
20%
box-shadow: 4px 4px 10px 0px rgba(0,0,0,0.20);

How to Use CSS Box Shadow Generator

  1. 1

    Adjust the horizontal offset, vertical offset, blur radius, spread radius, and colour using the controls.

  2. 2

    The preview box updates in real time to show the effect.

  3. 3

    Copy the generated CSS box-shadow property and paste it into your stylesheet.

About CSS Box Shadow Generator

Generate CSS box shadows visually. Adjust horizontal, vertical, blur, spread and colour with live preview. Multiple shadow layers supported. Copy the CSS instantly.

Best Use Cases

  • Designing card shadows for a UI component library
  • Creating depth effects for buttons and interactive elements
  • Building layered shadow effects for a modern SaaS design
  • Generating consistent shadow values for a design system
  • Prototyping elevation levels for Material Design style interfaces

Examples

Card shadow

Set a subtle shadow with 0px vertical offset, 4px blur, and low opacity for a clean floating card effect.

Button hover

Create a deeper shadow for button hover states. Copy the CSS and add it to your :hover pseudo-class.

Layered depth

Add multiple shadow layers with increasing blur and offset to create a realistic, multi-level depth effect.

Common Mistakes to Avoid

  • !Using pure black shadows instead of semi-transparent dark colors for natural depth
  • !Setting blur radius too high, which makes the shadow look unrealistic
  • !Forgetting to test shadows on both light and dark backgrounds

Limitations

  • Cannot preview shadows on custom HTML elements or your actual page layout
  • Does not generate text-shadow or filter drop-shadow CSS
  • Color picker may not match your exact design system color tokens

Frequently Asked Questions

Can I add multiple shadows?

Yes. Click 'Add layer' to stack multiple shadows on the same element. Each layer can have independent offset, blur, spread, colour, and inset settings.

What does 'Inset' do?

An inset shadow appears inside the element rather than outside it, creating a recessed or indented effect.