CSS Box Shadow Generator

Visually generate CSS box-shadow with live preview — multiple layers, colors, inset support.

Developer ToolsFreeNo Signup
CSS Box Shadow Generator
Free Tool

How to use CSS Box Shadow Generator

The CSS box-shadow property creates shadow effects on HTML elements — beneath cards, buttons, modals, and containers. Getting the values right by hand requires trial and error. The visual generator lets you drag sliders and see the result instantly, then copy the exact CSS. Shadow parameters: Horizontal offset (X) — positive values move shadow right; negative move left. 0 centers the shadow horizontally. Vertical offset (Y) — positive values move shadow down; negative move up. 0 centers the shadow vertically. Blur radius — 0 produces a hard-edged shadow. Higher values produce a softer, more diffuse shadow. Most card shadows use 8-24px blur. Spread radius — positive values expand the shadow beyond the element's bounds; negative values contract it. Spread 0 keeps the shadow the same size as the element. Color — choose any color including semi-transparent RGBA colors. Most realistic shadows use dark colors with low opacity (rgba(0,0,0,0.15) to rgba(0,0,0,0.4)). Inset — places the shadow inside the element rather than outside. Used for pressed-button effects, inner glow, and recessed panel styles. Multiple shadows: Add multiple shadow layers stacked together. Modern card designs often combine a close, dark shadow (for definition) with a distant, very soft shadow (for ambient depth). Example two-layer card shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24) Live preview shows the shadow on a card element with adjustable background color.

Frequently Asked Questions

What do the four box-shadow values mean?

The box-shadow syntax is: box-shadow: [horizontal-offset] [vertical-offset] [blur-radius] [spread-radius] [color]. Example: box-shadow: 4px 8px 16px 0px rgba(0,0,0,0.2). Horizontal offset moves shadow left/right, vertical moves up/down, blur makes it soft, spread expands or contracts it, and color sets the shadow color including opacity via RGBA.

What is an inset box shadow?

Adding the "inset" keyword places the shadow inside the element rather than outside. Outer shadows make elements appear elevated above the page. Inset shadows make elements appear recessed into the page — used for pressed button states, input field focus indicators, inner glow effects, and concave or sunken panel styles. The same x/y/blur/spread parameters apply but their direction flips.

How do I create a realistic card shadow?

Realistic card shadows use two layers: a close, crisp shadow for the contact shadow (0 1px 3px rgba(0,0,0,0.12)) and a diffuse ambient shadow (0 8px 24px rgba(0,0,0,0.08)). Use dark colors with low opacity rather than solid black. Shadows in the real world are slightly blueish-grey — try rgba(0,0,20,0.15) for a more natural tone than pure black.

Can I add multiple shadows in CSS?

Yes. Separate multiple shadows with commas: box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.08). Shadows render in the order listed — first shadow is on top. Multiple shadows let you combine a sharp near-shadow with a soft far-shadow for physically realistic depth. Use the "Add Layer" button in the generator to stack shadows visually.

What is the difference between box-shadow and text-shadow?

box-shadow applies to the box (border-box) of an HTML element — the rectangular area including padding and border. text-shadow applies to the letterforms of text content only. For card and container effects, use box-shadow. For headline effects, glows, or embossed text looks, use text-shadow. The CSS generator here focuses on box-shadow; text-shadow uses only x-offset, y-offset, blur, and color (no spread).

Recommended

Related Tools