

The browser will automatically use those for offset-x and offset-y. To assign a box shadow, you need at least two length values. box-shadow: offset-x offset-y blur-radius spread-radius color inset Here’s the order in which the values of the box-shadow property appear. You can use all common CSS data types that denote length for this value, like px, em, vh, and more. A positive value moves it to the right, a negative one to the left. The first value is the horizontal distance of the drop shadow from the side of its anchor element.

Plus, once you understand how they work, it no longer seems as confusing as in the beginning.Īs you can see above, box-shadow can take up to six values. When you look at an element with a box shadow using browser developer tools, you will find markup like this: box-shadow: inset 0 25px 40px 0 rgba(0, 0, 0, 0.3) īut don’t worry, you don’t need all of these declarations all the time. For now, let’s talk about how it works on the most basic level. This even holds true when you have set a border-radius property.Īround the web, people use it to create a number of different effects and we will see some interesting box-shadow examples below. The shadow will also adhere to the shape of its anchor, whether it’s square, rectangular, round, or oval. box-shadow is basically what the name says: it allows you to add a drop shadow to the frame of almost any element. What is CSS Box Shadow?Įven if you are not aware of the CSS box-shadow property until now, you have probably seen it in action on the web.Ībove is a good example of what it looks like in the wild (even if I have increased it here slightly to make a point).
#Drop shadow after effects stagger how to
We will talk about what it does, how to use its syntax correctly, some cool CSS box-shadow examples, and finally some generator tools that make working with it easier. In the guide below, we will go over everything there is to know about this CSS property. If so far you have struggled with using box-shadow properly, you have come to the right place. This might make especially challenging for beginners. Why does the box-shadow CSS property deserve its own tutorial? Because, as you will see below, it is one of the more complex properties that takes a number of values at the same time.
