Toolypet
CSS Tools/Box Shadow Generator

Box Shadow Generator

Create stunning box shadows with multiple layers and real-time preview

Preview

#F8FAFC

Shadow Layers

Layer 1
#0000001a
0px
4px
6px
-1px
Layer 2
#0000001a
0px
2px
4px
-2px

Presets

Loading...

CSS Box Shadow Guide

Learn how to create depth and dimension with shadows

What is Box Shadow?

The CSS box-shadow property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets, blur and spread radius, and color. It can create depth, highlight elements, and add visual interest to your designs.

How to Use This Tool

  1. Add shadow layers using the Add Layer button
  2. Adjust X/Y offset to position the shadow
  3. Control blur and spread for softness and size
  4. Toggle 'inset' for inner shadows, then copy the CSS

Pro Tips

  • Use multiple subtle shadows for more realistic depth effects
  • Negative spread values create tighter, more focused shadows
  • Combine outer and inset shadows for neumorphism effects

Browser Support

Box-shadow is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. It has been widely supported since IE9, making it safe for production use.

Frequently Asked Questions

What's the difference between blur and spread in box-shadow?

Blur radius determines how soft or diffused the shadow edges appear - higher values create softer shadows. Spread radius controls how much the shadow expands or contracts - positive values make the shadow larger than the element, while negative values make it smaller. Combining both creates realistic depth effects.

How do I create a shadow on only one side of an element?

Use offset values to position the shadow on one side (e.g., 0 10px for bottom only), set blur to soften edges, and use a negative spread value to prevent the shadow from appearing on other sides. For example: 'box-shadow: 0 10px 10px -10px rgba(0,0,0,0.5)' creates a bottom-only shadow.

What is neumorphism and how do I achieve it with box-shadow?

Neumorphism is a design style that creates soft, extruded plastic-like elements. It combines two shadows: a light shadow (usually white or light color) offset in one direction, and a dark shadow offset in the opposite direction. The element background should match the parent background for the best effect.

Does box-shadow affect page performance?

Box shadows can impact rendering performance, especially with large blur values or when applied to many elements. To optimize: avoid excessive blur radius, use will-change property for animated shadows, consider using pseudo-elements for complex shadows, and test on lower-end devices. Simple shadows have minimal performance impact.

Can I animate box-shadow properties?

Yes, box-shadow can be animated using CSS transitions or keyframe animations. However, animating shadows can be performance-intensive. For better performance, consider animating opacity of a pseudo-element with a fixed shadow instead, or use transform to move/scale an element with a shadow rather than animating the shadow itself.