Box-Shadow & Border-Radius Generator
Set up to three box shadows and a border radius, watch them on the preview, then copy the CSS.
Preview
CSS
How to use
- In Shadow 1, set the horizontal and vertical offset in pixels. Positive values move the shadow right and down.
- Set Blur (0 or more) for softness and Spread to grow or shrink the shadow. Pick a Colour and an Alpha from 0 to 1.
- Tick Inset to draw the shadow inside the box.
- Press Add a shadow for up to three layers, or Remove last shadow to drop one.
- Set the border radius. Leave "Same border radius on all four corners" ticked for one value, or untick it to set each corner.
- Check the preview and press Copy CSS.
Worked example
The page starts with a soft card shadow and an 8 pixel radius. The output is:
box-shadow: 0 4px 12px rgba(0,0,0,0.25);
border-radius: 8px;
Zero offsets and zero blur are written as plain 0, and spread is left out when it is zero. For a layered look, press Add a shadow once, then set Shadow 2 to offsets 0 and 8, blur 24, spread -6, colour black, alpha 0.15, and untick Inset. The negative spread pulls the shadow in so it does not stick out at the sides. The two layers are joined by a comma:
box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 8px 24px -6px rgba(0,0,0,0.15);
Unticking the single-radius box and entering 8, 4, 12 and 0 gives border-radius: 8px 4px 12px 0px;, which is top-left, top-right, bottom-right and bottom-left.
How it works
Each shadow is written as [inset] x y blur [spread] colour. A zero offset, blur or spread is written as 0, and spread is left out when it is zero. The colour is converted from the picker to rgba() with your alpha value. Shadows are joined with commas, with the first one on top.
Border radius is written in pixels. With four separate values, the order is top-left, top-right, bottom-right, bottom-left, as in CSS.
What each value does. Offset places the shadow. Blur spreads its edge over a distance, so a larger blur is softer and lighter. Spread grows the shadow's shape before blurring, or shrinks it when negative. An inset shadow is drawn inside the border, above the background. The shadow never changes layout and does not respond to clicks. Full detail is on MDN for box-shadow and border-radius.
The radius rounds each corner with a quarter-circle of that size. If neighbouring radii add up to more than the side they share, the browser scales them all down so they fit.
Common mistakes
- Using an opaque black shadow. Alpha near 1 looks harsh. Values between 0.1 and 0.3 are typical.
- Relying on shadow for meaning. A shadow alone is a weak signal for a focus state. Add an outline or border too.
- Stacking too many layers. Large blurs on many elements can slow scrolling on weak devices.
- Corner order. CSS goes clockwise from the top-left. People often assume it starts at the top-right.
- Negative blur. Blur cannot be negative in CSS, so the page does not allow it.
Frequently asked questions
What is the difference between blur and spread?
Blur softens the edge. Spread changes the size of the shadow before it is softened.
Why is there no colour name or hex in the output?
The picker gives a hex colour, and alpha needs a way to write transparency. The page writes both as rgba().
Can a shadow follow rounded corners?
Yes. box-shadow follows the element's border-radius automatically.
How do I make a pill or a circle?
Use a very large radius, such as 999px, for a pill. For a circle, use a square box and a radius of at least half its width.
Does it store my settings?
No. Everything runs in your browser.