ShareYourGroupShareYourGroupCSS Lab

CSS box-shadow generator

Soft modern shadows are usually two layers with low opacity. This tool starts there and lets you change every number.

The five numbers in a shadow

A box-shadow is written in this order: horizontal offset, vertical offset, blur, spread and colour, with the word inset in front if the shadow is inside the box.

Why two layers

The second layer in the preview is smaller and lighter than the first. Real shadows have a tight dark part near the object and a wide soft part further away, and stacking two shadows imitates that. The two layers are separated by a comma in the code. The first one is drawn on top.

Tips

What does inset do?

It draws the shadow inside the edge of the box, which makes the box look pressed in, such as an input field.

How is this different from drop-shadow()?

box-shadow follows the rectangular (or rounded) box. The filter: drop-shadow() function follows the real shape of the picture, including transparent areas, but has no spread and no inset.

This is an independent site. It is not connected with the W3C, MDN, Google, Apple, Mozilla or Microsoft. Browser and product names belong to their owners.