CSS Gradient & Box Shadow Generator
Build CSS gradients and box shadows visually and copy the code.
CSS Gradient Generator
Box Shadow Generator
About the CSS Gradient & Box Shadow Generator
The CSS Gradient and Box Shadow Generator builds two of the fiddliest bits of CSS visually. Pick two colours and an angle for a gradient, or set the offsets, blur, spread and colour of a box shadow, then copy the generated declaration.
A linear gradient runs along a line at the angle you choose, 0deg pointing up and 90deg pointing right. A radial gradient spreads out from a centre point instead, which suits spotlights and vignettes. Both accept any colour format CSS understands, including rgba for transparency.
Box shadows take an x offset, a y offset, a blur radius and optionally a spread, plus a colour. A positive y offset puts the shadow below the element, a negative one above it. Soft, realistic shadows use a large blur and low opacity, usually under 0.2, rather than a solid black.
Common questions about CSS Gradient & Box Shadow
What is a linear gradient?
A smooth transition between colours along a straight line, defined by an angle or a direction keyword.
How do the angle values work?
0deg points to the top and the angle increases clockwise, so 90deg runs left to right and 180deg top to bottom.
What do the box-shadow values mean?
Horizontal offset, vertical offset, blur radius, optional spread, then colour.
Can I use transparent colours?
Yes. rgba() or an eight-digit hex colour lets the shadow or gradient fade out.
Do I need vendor prefixes?
Not for current browsers. Prefixes were needed a decade ago for old Safari and Firefox versions.
Why does my shadow look harsh?
Usually too much opacity or too little blur. Try a blur of 20px or more with opacity around 0.1 to 0.15.