CSS Box Shadow Generator
Adjust offset, blur, spread, color, and opacity with sliders to generate a CSS box-shadow with a live preview. Copy the generated code with one click.
Tips
- You can type exact numbers into the input fields instead of dragging the sliders when you need precise values.
- Turn on "inset" to draw the shadow inside the element, creating a pressed-in, recessed look instead of a raised one.
- Increasing spread expands the whole shadow outline, while increasing blur softens and diffuses its edges — combine both for different textures.
- Lowering the opacity makes the shadow feel lighter and more natural, which helps when elements overlap on top of colored backgrounds.
- The generated CSS can be pasted directly into your stylesheet — it works especially well combined with hover effects on buttons and cards.
Frequently Asked Questions
Side Note — how box-shadow changed what the web could express
Before box-shadow was standardized in CSS3, creating a drop shadow on the web usually meant pre-rendering one into a background image in an image editor, or faking it by stacking several div elements with gradient backgrounds. Even a small tweak to the shadow's shape or softness meant redoing the image, which made design iteration slow and costly.
Once browsers began implementing box-shadow as part of CSS3 around 2009, a shadow could be produced with a single CSS declaration. No image assets were needed, pages became lighter to load, and shadows kept their shape correctly even as the layout resized responsively.
When Google introduced Material Design in 2014, it built the concept of "elevation" on top of box-shadow: each element is assigned a height along the Z-axis, and elements placed higher cast larger, darker shadows. This gave otherwise flat interfaces a sense of depth and hierarchy, an idea that still shapes many design systems today.