🌑

Box Shadow Generator

Create and preview CSS box-shadow styles

X Offset4px
Y Offset4px
Blur Radius10px
Spread Radius0px
Opacity20%
CSS Output
box-shadow: 4px 4px 10px 0px rgba(0, 0, 0, 0.20);

About This Calculator

CSS box-shadow adds depth and visual hierarchy to elements by creating shadow effects beneath or around them. This generator provides an interactive interface where you can adjust horizontal offset, vertical offset, blur radius, spread radius, color, and opacity to craft the perfect shadow. It supports multiple shadow layers for complex depth effects, inset shadows for pressed or recessed appearances, and generates cross-browser compatible CSS. Designers use box-shadow for card elevation, button hover states, modal dialogs, dropdown menus, and neumorphic UI designs. The tool previews changes in real time so you can fine-tune shadows visually without manually editing CSS values.

How to Use

  1. 1
    Set shadow values
    Adjust horizontal offset, vertical offset, blur, spread, and color.
  2. 2
    Preview live
    Watch the shadow update in real time on the preview element.
  3. 3
    Copy CSS
    Copy the generated box-shadow CSS code to your clipboard.

Frequently Asked Questions

Q. What is the difference between box-shadow and drop-shadow?
box-shadow applies a rectangular shadow to the element box, while filter: drop-shadow() follows the actual shape of the element including transparency in images. Use box-shadow for cards and containers; use drop-shadow for non-rectangular shapes like PNG icons.
Q. How do I add multiple shadows to one element?
Separate multiple shadow values with commas: box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.1). The first shadow in the list renders on top. Layered shadows create more realistic depth than a single heavy shadow.
Q. What is an inset shadow?
Adding the inset keyword places the shadow inside the element instead of outside, creating a pressed or recessed look. It is commonly used for input fields, toggle switches, and neumorphic UI designs.

Disclaimer: Results are for informational purposes only and do not constitute professional advice. Always consult qualified professionals for important decisions.