Rankite
ServicesResultsToolsTeamAboutBlogCareersContactFree SEO Audit
Free tool

CSS Box Shadow Generator: Live Preview and Copy-Ready Code

Adjust offset, blur, spread, color and inset to preview a box shadow in real time, then copy the finished CSS box-shadow declaration.

Home / Tools / CSS Box Shadow Generator
CSS output
box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.2);

Built by Rankite, the SEO team behind Swordfish AI's +400% revenue and Zluri's +45% organic growth. See the case studies

How CSS box-shadow syntax works

The box-shadow property follows a fixed order defined in the CSS Backgrounds and Borders Module Level 3 specification: offset-x, offset-y, blur-radius, spread-radius, then a color. Offset moves the shadow horizontally and vertically, blur softens its edge into a gradient, and spread grows or shrinks the shadow's shape before the blur is applied.

Inset vs outer shadows

Adding the inset keyword switches the shadow from an outer drop shadow, which appears to lift an element off the page, to an inner shadow that sits inside the element's border, which reads as a pressed or recessed surface. Both use the exact same offset, blur, spread and color values; only the keyword changes which side of the edge the shadow renders on.

Using rgba for a realistic, soft shadow

box-shadow accepts any valid CSS color, but rgba lets you control the shadow's opacity separately from its base color, which is how most real interfaces achieve a soft, semi-transparent shadow instead of a harsh solid block. A shadow with an alpha value between 0.1 and 0.3 tends to look more natural than a fully opaque one on most light backgrounds.

Related articles

FAQ

CSS Box Shadow Generator: questions, answered

What does each box-shadow value mean?
box-shadow follows offset-x, offset-y, blur-radius, spread-radius, then color, per the CSS Backgrounds and Borders Module Level 3 specification. Offset moves the shadow, blur softens its edge, and spread grows or shrinks it before the blur is applied.
What does the inset keyword do?
Adding inset switches the shadow from an outer drop shadow to an inner shadow that sits inside the element's border, useful for pressed-button or recessed-panel effects.
Can I stack more than one shadow?
Yes. box-shadow accepts a comma-separated list of shadow definitions, though this generator outputs a single shadow that you can duplicate and adjust manually for layered effects.
Why use rgba instead of a hex color for the shadow?
rgba lets you control the shadow's opacity separately from its color, which is how most real interfaces get a soft, semi-transparent shadow instead of a harsh solid-color box.
Does box-shadow affect page layout?
No. box-shadow is purely visual and doesn't take up space in the document flow the way a border or margin would, so it never shifts surrounding elements.

More free tools

Let's grow

Ready to own page one?

Get a free, no-obligation SEO audit and a 30-minute strategy session. We'll show you exactly where the growth is hiding.

Book your free audit Explore services
Get in touch

Tell us about your project

Fill out the form and we'll get back to you within one business day. Prefer email? Write to us directly at contact@rankite.com.

Or copy our email and write to us directly: contact@rankite.com