CSS Box Shadow Generator – Create & Copy CSS Online

CSS Box Shadow Generator

Create layered CSS box shadows, adjust blur and opacity, and copy the code for your website.

Shadow settings

Adjust your shadow and see the result instantly.

Shadow layers

1 / 5

-100px100px
-100px100px
0px100px
-50px100px
#0D1F24
0%100%
Inset shadow Draw the shadow inside the element.

Live preview

Preview Your box shadow updates as you adjust the settings.

CSS output

box-shadow: 0px 8px 24px 0px rgba(13, 31, 36, 0.18);

Copy the declaration into the CSS rule for your element. Multiple shadows are separated by commas.

Box Shadow Properties Explained: Offsets, Blur, Spread and Layers

A CSS box shadow generator makes it easier to create realistic depth, subtle elevation, and inset effects without repeatedly editing CSS by hand. Adjust the offset, blur, spread, color, and opacity, preview your changes, combine multiple shadow layers, and copy the resulting CSS into your website.

How to Create a CSS Box Shadow

Use the generator to build a shadow visually, then copy the CSS declaration into the rule for the element you want to style.

  1. 1 Choose a starting style Select a preset such as Soft, Floating, Crisp, or Inset to begin with a useful combination of settings.
  2. 2 Adjust the shadow Change horizontal and vertical offset, blur radius, spread radius, color, and opacity until the shadow suits your design.
  3. 3 Preview and refine Compare the effect against different preview backgrounds. Add more layers when a single shadow is not enough.
  4. 4 Copy the CSS Copy the generated box-shadow declaration and place it inside the CSS rule for your button, card, image, or other element.

Three Common CSS Shadow Styles

Different shadow styles communicate different levels of depth. A soft shadow can suggest elevation, a crisp shadow creates a more defined edge, and an inset shadow makes an element appear recessed.

ExampleCSS
Soft shadowbox-shadow: 0 4px 16px 0 rgba(13, 31, 36, 0.12);
Crisp shadowbox-shadow: 0 2px 4px 0 rgba(13, 31, 36, 0.25);
Inset shadowbox-shadow: inset 0 2px 8px 0 rgba(13, 31, 36, 0.18);
Compare shadow effects: these are illustrative CSS examples, not results generated by your current settings in the tool.

What Each Box Shadow Property Does

A standard CSS box shadow uses horizontal and vertical offsets, followed by optional blur and spread values and a color. The inset keyword changes the shadow from an outer shadow to an inner one.

PropertyWhat it controlsPractical guidance
Horizontal offsetMoves the shadow left or right.Positive values move it right; negative values move it left.
Vertical offsetMoves the shadow up or down.Positive values move it down; negative values move it up.
Blur radiusControls how soft the shadow edge appears.Use a small value for a sharper edge and a larger value for a softer shadow.
Spread radiusExpands or shrinks the shadow before blur is applied.Positive values expand it; negative values shrink it.
Color and opacityControl the shadow's hue and transparency.Lower opacity often creates a more subtle effect.
InsetPlaces the shadow inside the element.Useful for recessed surfaces and pressed-in interface effects.

How to Combine Multiple Box Shadows

CSS lets you apply more than one shadow to the same element. Separate each shadow with a comma. This can combine a broad, subtle shadow with a smaller, sharper one for a more layered appearance.

For example, this declaration combines two outer shadows:

Two-layer shadow example box-shadow: 0 2px 4px rgba(13, 31, 36, 0.12), 0 8px 24px rgba(13, 31, 36, 0.10);

The first shadow is listed first and appears above subsequent shadows in the painting order. Adjust both layers to preserve a natural sense of depth.

In the Clicktoolset generator, you can add and edit up to five shadow layers independently. Each layer has its own offset, blur, spread, color, opacity, and inset setting. The preview and CSS output update as you make changes.

Tips for Better-Looking UI Shadows

  • Start subtle: A low-opacity shadow is often more natural than a dark, sharply defined one on a light interface.
  • Match the direction: Use consistent offsets for components that appear to share the same light source.
  • Choose blur carefully: Larger blur values generally make the transition softer, while crisp shadows work better for more defined edges.
  • Check the background: A shadow that looks clear on white may be too weak on a dark surface. Test it against the background where the element will actually appear.
  • Keep layers purposeful: Multiple shadows can add depth, but unnecessary layers may make an interface look heavy.

Frequently asked questions

How do you create a box shadow in CSS?
Use the box-shadow property with horizontal and vertical offsets, followed by optional blur and spread radii and a color. For example, box-shadow: 0 4px 16px rgba(13, 31, 36, 0.12); creates a downward, blurred shadow. You can adjust the values in the generator and copy the resulting CSS.
What is the difference between blur and spread?
Blur controls how soft the shadow's edges appear. Spread changes the shadow's size before the blur effect is applied. Positive spread expands the shadow, while negative spread makes it smaller. They affect different aspects of the final appearance.
How do I create an inset box shadow?
Add the inset keyword to the box-shadow declaration, such as box-shadow: inset 0 2px 8px rgba(13, 31, 36, 0.18);. This places the shadow inside the element rather than outside it.
Can an element have multiple box shadows?
Yes. Separate each shadow with a comma in the same box-shadow declaration. Multiple layers can combine different offsets, blur values, spread values, and colors. The generator lets you create and edit up to five layers.
Does a box shadow change an element's layout size?
A CSS box shadow does not change the element's box-model dimensions. However, a large outer shadow can visually extend into nearby content or beyond a container, so leave sufficient surrounding space when necessary.