About the Box Shadow Generator
Design a CSS box shadow with sliders instead of guessing at four pixel values. The preview box changes as you drag, and the box-shadow line underneath it is ready to paste into your stylesheet. It covers the usual jobs: a soft card shadow, a button that looks lifted off the page, or an inner shadow on an input field.
A second tab builds a glassmorphism panel: a see-through surface that blurs whatever sits behind it, with a faint light border. The two modes sit side by side at the top. If you get lost, Reset Properties puts every slider back where it started.
What each slider changes in the shadow CSS
A CSS shadow is a copy of the element's shape drawn behind it. The horizontal and vertical offsets move that copy right or down (negative values move it left or up). Blur radius softens the edge: at 0 the shadow is a hard-edged block, and larger values fade it out over a wider band. Spread radius grows or shrinks the shape before it is blurred, so a negative spread tucks the shadow in under the box and a positive one makes it reach out on every side.
The shadow is black until you pick another colour with Shadow Colour, and the opacity slider sets how strong it is. Both go into one rgba() value, so the page behind shows through. Ticking Inset Shadow adds the inset keyword, which draws the shadow inside the box instead of outside, the look used for pressed buttons and sunken input fields.
In Glassmorphism mode the code is four lines: a white background at the surface opacity you choose, backdrop-filter: blur() to blur what is behind the element, the same filter with the -webkit- prefix for Safari, and a 1px white border at the border opacity you set.
box-shadow: [inset] <x>px <y>px <blur>px <spread>px rgba(<r>, <g>, <b>, <opacity>); r g b the Shadow Colour (0, 0, 0 = black, the default) x horizontal offset, -50 to 50 y vertical offset, -50 to 50 blur 0 to 100 (0 = sharp edge) spread -30 to 50 (negative = smaller than the box)
Assumptions and limits
- One shadow layer at a time. For a layered shadow, copy the first value, change the sliders, and join the two values with a comma in a single box-shadow declaration.
- For a coloured glow, pick the colour with Shadow Colour: the copied rgba() holds its red, green and blue values with the opacity from the slider, so #2563eb at 50% becomes rgba(37, 99, 235, 0.5).
- Offsets, blur and spread move in whole pixels within the slider ranges; for larger values edit the copied numbers.
- The glass preview card uses exactly the four copied lines and nothing more, so it looks the same on your page over a similar background. Add a box-shadow line yourself if you want the panel to lift off the page.
- A glass panel only looks like glass when there is something colourful or detailed behind it. On a plain single-colour page the blur has nothing to work on and the panel just looks pale.
Worked examples
The default soft card shadow
The starting values make a shadow that sits below the box and slightly inside its edges, which reads as a card lifted a little off the page. Pricing cards, modals and dropdown menus often use something close to it.
Sliders: x 0, y 10, blur 25, spread -5, opacity 50% box-shadow: 0px 10px 25px -5px rgba(0, 0, 0, 0.5);
A pressed button with an inset shadow
Tick Inset Shadow, set the vertical offset to 2, blur to 6, spread to 0 and opacity to 35%. The shadow now appears along the inside top edge, so the button looks pushed into the page. That's the look you want for an :active state.
box-shadow: inset 0px 2px 6px 0px rgba(0, 0, 0, 0.35);
A frosted glass login panel
Switch to Glassmorphism, set backdrop blur to 16px, surface opacity to 10% and border opacity to 25%, then place the panel over a photo or gradient background.
background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.25);
How to use the Box Shadow Generator
- Pick a mode. Box Shadow Generator for a normal or inset shadow, Glassmorphism Generator for a frosted see-through panel.
- Drag the sliders. Watch the preview box while you change offsets, blur, spread, opacity and colour, or the glass blur and border; tick Inset Shadow for an inner shadow.
- Grab the declaration. Use the Copy CSS button above the code and drop the line into the rule for your card, button or panel.
Frequently asked questions
What is the difference between blur and spread in CSS box-shadow?
Blur controls how soft the edge is: 0 gives a crisp outline and higher values fade the shadow over a wider area. Spread changes the size of the shadow shape before blurring, so 10px makes it 10px bigger on every side and -5px makes it smaller than the box.
How do I make a shadow only at the bottom of a box?
Use a vertical offset larger than zero, a horizontal offset of 0 and a negative spread about as big as the blur, for example 0px 12px 12px -10px. The negative spread pulls the shadow in at the sides, so only the part pushed down by the offset shows below the box.
How do I add more than one shadow?
CSS accepts a comma-separated list in one declaration, such as box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.2), 0px 10px 25px -5px rgba(0, 0, 0, 0.5);. Build each layer here, copy it, and join them; the first one listed is drawn on top.
Does box-shadow change the size or layout of the element?
No. Shadows are painted outside the normal layout, so they never push other elements around or change scrollbars. They can be cut off by a parent with overflow: hidden, so give the parent some padding if the edge of the shadow disappears.
Does backdrop-filter work in every browser?
In current browsers, yes: Chrome, Edge, Firefox and Safari all support it. Older Safari versions only read the -webkit-backdrop-filter line, which is why the generated glass CSS includes both. A browser without support still shows the semi-transparent background; you only lose the blur.
Why does my inset shadow not show on an image?
An inset shadow is painted above the element's background but below its content, and an img element's picture counts as content. Put the image inside a wrapper element and give the inset shadow to a pseudo-element placed over it, or use the image as a CSS background instead.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.