What is a box shadow?

The CSS box-shadow property draws a shadow around an element's box, such as a card, a button or an image. It takes a horizontal and a vertical offset, a blur radius, a spread radius and a color. With the inset keyword, the shadow falls inside the box instead, as if the box were pressed into the page.

Tool description

Move the sliders for Horizontal Offset (X), Vertical Offset (Y), Blur Radius and Spread Radius, pick the Shadow Color and set its Opacity. The preview box shows the shadow as you go, and the CSS under it is ready to copy. Tick Inset shadow to put the shadow inside the box.

Preview Box Color changes the color of the box in the preview only, so it isn't part of the CSS. The preview can also be saved as a PNG or JPG image.

The tool starts with a soft shadow below the box: box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.25);

Features

  • Sliders for the offsets, blur radius and spread radius of a box shadow
  • A shadow color with its own opacity, written as rgba()
  • Outer or inset shadows, with a live preview and the CSS ready to copy

Tips

  • Negative offsets move the shadow left or up, and a negative spread makes it smaller than the box.
  • A low opacity and a blur about twice the vertical offset, like the starting values, give a soft and natural shadow.
  • The tool makes one shadow. For a layered look, add more shadows to the same property, separated by commas: box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), 0px 8px 16px rgba(0, 0, 0, 0.15);