Shaping a shadow
Start from the default
The preview card begins with a gentle shadow 8 px down, blurred over 24 px, pulled in by 6 px and at 25% opacity.
Move the sliders
Across and Down shift the shadow, Blur softens it, Spread grows or shrinks it before blurring, and Opacity sets its strength. Pick the colour beside them.
Add depth with layers
Each new layer copies the last one with the offset and blur doubled, up to five. Remove any layer you do not need.
Try inset
Ticking Inset draws the shadow inside the box, for pressed buttons and input fields.
Copy
The CSS box at the bottom holds the complete
box-shadowdeclaration.
Example: a soft two-layer card shadow
A designer building a testimonials section for a dental practice website wants cards that look lifted but not heavy. Pressing Add a layer once on the default shadow produces a second, longer and softer shadow beneath the first.
The copied rule is below. Using a dark navy rather than pure black for the shadow colour keeps it from looking grey and dirty on a white page.
Default layer plus one added layer
box-shadow: 0px 8px 24px -6px rgba(15, 23, 42, 0.25), 0px 16px 48px -6px rgba(15, 23, 42, 0.25);
Box shadow terms
- Offset
- The Across (x) and Down (y) distances. Negative values move the shadow left or up.
- Blur
- How far the edge of the shadow fades. Zero gives a hard edge.
- Spread
- Expands (positive) or shrinks (negative) the shadow before it is blurred. A negative spread with a large blur gives a soft shadow that stays under the box.
- Inset
- Draws the shadow inside the element instead of outside it.
Questions people ask
How do I add a shadow to a box in CSS?
The box-shadow property takes up to four lengths followed by a colour: sideways offset, downward offset, blur and spread, in that order. Rather than writing them by hand, set them with the sliders on this page, watch the card, and paste the generated declaration into your stylesheet or site builder.
How do I make a shadow look more realistic?
Stack two or three layers: a small, sharper shadow close to the box and a larger, softer one further away, each at low opacity. Real light produces both a contact shadow and a diffuse one, so layered shadows read as more natural than a single dark blur.
What is the difference between box-shadow and text-shadow?
box-shadow applies to the rectangle of an element, including its rounded corners, and supports spread and inset. text-shadow follows the shape of the letters and has neither. Map Extract's text shadow generator handles lettering.
Where your data goes
The preview and the CSS are generated in your browser. Your settings are not sent or stored.
Checked against the tool on