Send feedback

Coming from the page: CSS Box Shadow Generator

One moment…

Multiple layersPresetsCSS & Tailwind code

CSS Box Shadow Generator

Design a shadow for your buttons and cards, see it live, and copy the code.

CSS
Tailwind
Presets
Layers
px
px
px
px
%

How to make a box shadow

1

Start from a preset

Pick soft, card, floating or another one, or start from scratch.

2

Adjust the layers

Move the offset, blur, spread, color and opacity, and add a second layer for a more natural shadow.

3

Copy the code

Copy the CSS line into the element’s rule, or copy the Tailwind class.

The parts of box-shadow

Syntax: box-shadow: [inset] x y blur spread color

PartWhat it doesExample
Horizontal offset xPositive moves right, negative left4px
Vertical offset yPositive moves down, negative up8px
BlurLarger is softer and wider (never negative)16px
SpreadGrows or shrinks the shadow before blurring-4px
ColorUsually black with light transparencyrgba(0, 0, 0, 0.15)
insetPuts the shadow inside the elementinset 0 2px 6px ...

Tips for a good shadow

Light shadows look better. An opacity of 8% to 20% is usually enough; very dark shadows look dated.

Use two or more layers. A close sharp shadow plus a far soft one looks like a real shadow. Try the “Layered” preset.

One light direction. Keep the vertical offset positive across your site, as if light comes from above.

The preview is the code itself: The preview box is drawn with exactly the code you copy, so what you see is what your site shows. The tool runs in your browser.

FAQ

How do I add a shadow to an element in CSS?

Add the box-shadow property to the element’s rule, for example .card { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }. In WordPress, put it in Appearance → Customize → Additional CSS.

How do I make an inner shadow?

Turn on “Inset”, which adds the inset keyword at the start of the shadow.

How do I add several shadows to one element?

Press “+ Layer”. Shadows are separated by commas, and the first one is drawn on top.

What’s the difference between box-shadow and drop-shadow?

box-shadow draws around the element’s box (with its rounded corners). filter: drop-shadow() follows the shape of a transparent PNG or SVG, and has no spread or inset.

Does it work in all browsers?

Yes. box-shadow has been supported by every browser for years and needs no -webkit- prefix.