CSS Box Shadow Generator
Create CSS box shadows visually and copy the generated code.
Presets
How It Works
Use sliders to control shadow offset, blur, spread, colour, and opacity. See the live preview and copy the CSS box-shadow property.
**CSS Box Shadow Generator — Design Shadows Visually**
Box shadows are one of the most versatile CSS effects, used for cards, buttons, modals, and depth effects. Our visual generator lets you design the perfect shadow with sliders and copy the CSS instantly.
**The CSS box-shadow Property**
Syntax: `box-shadow: offset-x offset-y blur-radius spread-radius color;`
**Parameters:**
- **offset-x** — Horizontal shadow position (negative = left, positive = right)
- **offset-y** — Vertical shadow position (negative = up, positive = down)
- **blur-radius** — How blurry the shadow is (0 = sharp edge)
- **spread-radius** — How far the shadow expands beyond the element
- **color** — Shadow colour (supports rgba for opacity)
- **inset** — Keyword to create an inner (inset) shadow
**Example Shadows**
Subtle card shadow:
`box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);`
Elevated button:
`box-shadow: 0 4px 6px rgba(50,50,93,0.11), 0 1px 3px rgba(0,0,0,0.08);`
Deep shadow:
`box-shadow: 0 10px 30px rgba(0,0,0,0.3);`
Inset shadow (sunken):
`box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);`
**Multiple Shadows**
CSS allows multiple shadows separated by commas:
`box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.1);`
This creates a more realistic layered shadow effect.
**Material Design Shadow Levels**
Google's Material Design defines 24 elevation levels. Key ones:
- **Level 1 (Cards):** 0 1px 3px rgba(0,0,0,0.2)
- **Level 4 (FAB hover):** 0 4px 5px rgba(0,0,0,0.2)
- **Level 8 (Menus):** 0 8px 10px rgba(0,0,0,0.2)
- **Level 16 (Modals):** 0 16px 24px rgba(0,0,0,0.2)