Create simple or complex multi-layer CSS box shadows visually. Adjust offsets, blur, spread, colors, and opacity with real-time preview, instant CSS copy, and download.
Combine multiple shadow layers to achieve realistic, soft optical depth. Click any layer to edit:
/* Calculating CSS... */
Click any preset to instantly apply its offsets, blur, spread, and layer combinations:
The CSS box-shadow property attaches one or more drop-shadow effects around an element’s frame. Mastering offsets, blur, spread, and multi-layer optical blending is crucial for creating modern, professional web interfaces.
box-shadow: [inset] <offset-x> <offset-y> <blur-radius> <spread-radius> <color>;
Offset-X shifts the shadow horizontally (positive moves right, negative moves left). Offset-Y shifts the shadow vertically (positive moves down, simulating a light source from above, negative moves up).
Blur radius applies a Gaussian blur smoothing the shadow edges (0px produces a crisp silhouette). Spread radius expands (positive) or contracts (negative) the shadow shape before blurring.
Single shadows often appear harsh or muddy. Modern UI design stacks two layers: a tight, darker shadow for contact definition, plus a large, soft ambient shadow for realistic atmospheric elevation.
| Parameter | Type / Unit | Default | Description |
|---|---|---|---|
inset |
Keyword (optional) | Outset (default) | Draws the shadow inside the border frame (sunken/depressed look). |
offset-x |
Length (px, em, rem) | Required (0px) | Horizontal displacement along the X-axis. |
offset-y |
Length (px, em, rem) | Required (0px) | Vertical displacement along the Y-axis. |
blur-radius |
Length (px) ≥ 0 | 0px (sharp) | Radius of the Gaussian blur algorithm applied to the shadow perimeter. |
spread-radius |
Length (px) | 0px | Grows or shrinks the shadow footprint prior to blurring. Negative spread prevents side bleed. |
color |
Color (HEX, RGB, RGBA, HSL) | currentColor | Color of shadow. Best practice is semi-transparent rgba(0,0,0, 0.05 - 0.20). |
box-shadow property allows web developers to render drop shadows around an HTML element’s frame. It accepts horizontal and vertical offsets, an optional blur radius, an optional spread radius, and a color value. Multiple shadows can be chained using commas to create lifelike 3D depth.
inset keyword changes the shadow rendering from an exterior drop shadow to an internal shadow drawn within the element’s padding box. Inset shadows are widely used for pressed buttons, sunken form input fields, well containers, and neumorphic tactile UI designs.
box-shadow without prefixes since 2012. However, including -webkit-box-shadow ensures backward compatibility with legacy WebKit browsers and embedded Android WebViews. Our tool provides a toggle so you can include or omit it as desired.
offset-y: 16px), a positive or zero spread will cause the shadow to visibly peek out of the left, right, and top edges. Using a negative spread (e.g. -4px) shrinks the lateral footprint so the shadow only emerges beneath the element, matching natural light shadows.
.css stylesheet file immediately.