Interactive online courses HTML Academy
2026-03-09 10:48 Diff

You can add a shadow to an object using the drop-shadow filter. The filter syntax is the same as the one used for the box-shadow property.

.effect { /* Black shadow offset by 10px horizontally and 5px vertically, with a blur radius of 3px */ filter: drop-shadow(10px 5px 3px #000000); /* Green shadow that is not offset with a 5px blur radius */ filter: drop-shadow (0px 0px 5px green); }

Unlike box-shadow, the filter does not support the inset parameter for the inner shadow.

In addition, as of the time of writing of this section, stretch is not supported in the shadow filter (you can find more details about how stretch is used in the box-shadow property in the “Shadow Play” section).