AIForeverThing

CSS Box Shadow Generator

Create perfect box shadows visually and copy the ready-to-use CSS code.

Preview

Controls

4px
4px
12px
0px
30%
#ffffff
/* Click Calculate to generate code */

How It Works

The CSS box-shadow property follows the syntax: box-shadow: [inset] x y blur spread color. The X and Y offsets position the shadow relative to the element. The blur radius determines how soft the shadow edges are — higher values create a more diffuse shadow. The spread radius grows or shrinks the shadow shape before blurring is applied. Our generator converts your visual adjustments into the correct RGBA color value by combining your chosen color with the opacity percentage, then outputs production-ready CSS code you can paste directly into your stylesheet.

Frequently Asked Questions

What do the values in a CSS box-shadow mean?

The CSS box-shadow property accepts values in this order: horizontal offset, vertical offset, blur radius, spread radius, and color. A positive horizontal offset moves the shadow to the right; a positive vertical offset moves it downward. The blur radius controls softness (0 for sharp edges), and spread radius expands or contracts the shadow size.

How do I create an inset box shadow in CSS?

Add the 'inset' keyword before the shadow values in the box-shadow property. For example: box-shadow: inset 0 2px 4px rgba(0,0,0,0.3). This creates an inner shadow that appears inside the element's borders, giving it a recessed or pressed-in appearance.

Can I apply multiple box shadows to one element?

Yes, you can stack multiple box shadows on a single element by separating each shadow definition with a comma. For example: box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.1). This creates layered depth effects commonly used in modern UI design.