CSS Box Shadow Generator

Create beautiful CSS box shadows with live preview. Adjust offset, blur, spread, color, and opacity — then copy the CSS.

Preview Card
Your box shadow is applied to this element. Adjust the controls below to see changes in real time.

Shadow Layers

CSS Output


      
    

Shadow Presets

Click any preset to load it into the editor.

What is a CSS Box Shadow Generator?

A CSS box shadow generator is a visual design tool that helps you create shadow effects for HTML elements without writing box-shadow syntax by hand. You can adjust horizontal and vertical offsets, blur radius, spread radius, shadow color with opacity, and toggle inset mode — all with a live preview. The tool outputs standard CSS code that works in all modern browsers.

Understanding the Box-Shadow Property

The CSS box-shadow property adds one or more shadow effects to an element's frame. The syntax is:

box-shadow: [inset] offset-x offset-y blur-radius spread-radius color;

  • Horizontal Offset (offset-x): Moves the shadow left (negative) or right (positive). A value of 0 centers the shadow horizontally.
  • Vertical Offset (offset-y): Moves the shadow up (negative) or down (positive). A value of 0 centers the shadow vertically.
  • Blur Radius: Controls how soft or sharp the shadow edge is. 0 creates a sharp shadow; higher values produce softer, more diffused shadows.
  • Spread Radius: Expands (positive) or shrinks (negative) the shadow relative to the element. Use positive spread for larger shadows and negative spread for tighter, more focused shadows.
  • Color: Sets the shadow color, often with transparency using rgba() or hsla(). Semi-transparent shadows look more natural and realistic.
  • Inset: Adding the inset keyword places the shadow inside the element, creating a recessed or pressed effect.

Multiple Box Shadows

You can apply multiple shadows to a single element by separating each shadow value with a comma. The first shadow in the list appears on top. Layering multiple shadows is a common technique for creating realistic depth, material design elevation levels, and complex lighting effects. This generator supports adding and removing multiple shadow layers independently.

Common Shadow Patterns

  • Subtle: Small offsets with moderate blur and low opacity create gentle, natural-looking shadows perfect for cards and containers.
  • Material Design: Multiple layered shadows with increasing blur and offset mimic physical elevation, a core principle of Material Design.
  • Glow: Zero offset with high blur and a bright color creates a neon glow effect, popular for dark-themed UIs and gaming sites.
  • Sharp: Zero blur with a small offset creates a hard-edged retro shadow, great for bold, graphic design styles.

Frequently Asked Questions

What is a CSS box-shadow generator?

A CSS box-shadow generator is a visual tool that lets you create box-shadow effects by adjusting offset, blur, spread, and color values. It outputs ready-to-use CSS code you can paste directly into your stylesheets.

What do the box-shadow values mean?

The box-shadow property takes values for horizontal offset, vertical offset, blur radius, spread radius, and color. Horizontal offset moves the shadow left or right, vertical offset moves it up or down, blur radius controls softness, and spread radius expands or shrinks the shadow size.

What is an inset box shadow?

An inset box shadow appears inside the element rather than outside it. Adding the 'inset' keyword to the box-shadow property creates an inner shadow effect, useful for pressed buttons, input fields, and recessed UI elements.

Can I add multiple box shadows to one element?

Yes, you can add multiple box shadows by separating each shadow with a comma. Multiple shadows are layered on top of each other, with the first shadow on top. This technique is commonly used for realistic depth effects and material design elevation.

How do I create a glowing shadow effect?

To create a glow effect, set both offsets to 0, use a large blur radius, and choose a bright or neon color. Increase the spread radius for a wider glow. Combining multiple colored shadows produces vibrant neon glow effects.

Is the box-shadow property supported in all browsers?

Yes, box-shadow is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. It has been widely supported since IE9, so vendor prefixes are no longer needed.

Is this box shadow generator free to use?

Yes, this CSS box shadow generator is completely free. It runs entirely in your browser with no sign-up required. All shadow generation happens client-side — no data is sent to any server.

Related Tools