This page builds a CSS box-shadow from five values and a colour. Move the sliders for horizontal and vertical offset, blur and spread, set an opacity, choose the shadow colour and tick inset if you need the shadow inside the box. The preview updates as you change a control, and the CSS panel holds a complete rule you can copy or download.
The output is one declaration in a class called .shadow. Rename the class or lift the box-shadow line into your own rule; nothing else is generated, and no vendor prefixes are added because every current browser supports the unprefixed property.
The five values and what they do
The order is fixed: horizontal offset, vertical offset, blur radius, spread radius and colour. Positive offsets move the shadow right and down; negative offsets move it left and up. A blur of zero gives a hard edge, while a larger blur softens the edge over that distance. Spread grows the shadow before it is blurred, so a positive spread makes it larger than the box and a negative spread shrinks it.
The sliders here allow −60 to 60 pixels on each offset, 0 to 120 on blur and −40 to 60 on spread. Those ranges cover ordinary interface shadows. A value outside them is possible in CSS but is easier to write by hand than to reach with a slider.
Blur and spread are not the same control even though both make a shadow look bigger. Blur fades the edge; spread moves the edge outward while keeping it solid. A large spread with a small blur produces a heavy rim, which is why the checklist warns when the absolute spread is larger than the blur.
Colour, opacity and alpha
The colour field accepts a six-digit hex value such as #1c1b18. The separate opacity slider is applied as the alpha channel of an rgba() colour, so 18% becomes rgba(28, 27, 24, 0.18). The stats show the alpha to two decimal places, while the CSS prints the shortest form: 50% appears as 0.5, not 0.50.
An invalid colour does not raise an error. The field is checked against a six-digit hex pattern, and anything else silently falls back to #1c1b18. If the CSS suddenly looks dark grey, check the colour field first; a named colour such as rebeccapurple or a three-digit value such as #333 is not accepted here even though CSS itself would accept it.
The preview surface is a separate colour field. It changes the background behind the sample card so a light shadow is visible, and it is deliberately left out of the CSS. Copying the declaration will not carry the surface with it.
A worked example
The default settings produced the declaration below. The offset is 12 pixels across and 18 down, the blur is 40 pixels, the spread is zero and the colour is the default ink at 18% opacity.
| Setting | Values | CSS |
|---|---|---|
| Default | 12, 18, 40, 0, #1c1b18, 18% | box-shadow: 12px 18px 40px 0px rgba(28, 27, 24, 0.18); |
| Inset | −10, −8, 0, 20, #ff0000, 50% | box-shadow: inset -10px -8px 0px 20px rgba(255, 0, 0, 0.5); |
The second run is a hard inner shadow: no blur, a 20-pixel spread and an inset flag. It looks like a thick red edge inside the card. The checklist correctly warned that the spread was larger than the blur, which is the setting most likely to produce a heavy band rather than a soft shadow.
A third run typed red into the colour field at full opacity. The page kept working and wrote rgba(28, 27, 24, 1), because the invalid value fell back to the default. That is useful to know before you spend time wondering why the preview did not change.
rgba(28, 27, 24, 1), not #1c1b18. Both are valid CSS; the generator simply always writes the alpha channel.Inset shadows and layering
inset moves the shadow inside the element. The offsets then behave as if the light were inside the box: a positive vertical offset puts the shadow at the top edge, which is why inner shadows often use a negative value. Inset shadows are common for pressed buttons, input wells and cards with a cut-out look.
The generator writes one layer. Real interfaces often stack two or three: a tight dark shadow for contact and a wide soft one for depth. To do that, copy the declaration and repeat it after a comma, for example box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.08);. Each layer is painted in order, with the first on top.
Shadows do not affect layout. They are painted outside the border box and can overlap neighbouring elements, so a large blur may be clipped by an ancestor with overflow: hidden. Check the component in its real container, not only on the preview card.
Copying the result
The CSS panel contains a complete rule, so you can paste it into a stylesheet and rename the selector, or copy only the declaration. The copy button copies the whole rule; the download button saves it as box-shadow.css. Neither action sends anything to a server.
For a quick comparison of two shadows, keep the page open in two tabs and paste each result into your own preview. The CSS beautifier is useful if the declaration ends up inside a minified stylesheet, and the gradient generator covers the background behind the card.