user16547868
user16547868

Reputation:

How can I add depth with box-shadow in css?

How can I add depth with box-shadow in Css? Could you please explain to me or suggest a resource. I found this line of code but i can't understand it.

box-shadow: 4px 8px 4px -2px #ccc,  0px 0px 6px -2px #ccc;

Upvotes: 0

Views: 274

Answers (1)

Gerrnperl
Gerrnperl

Reputation: 330

In

box-shadow: 4px 8px 6px -2px #ccc;

4px is the x-offset of the shadow

8px is the y-offset of the shadow

6px is the blur-radius of the shadow

-2px is the spread-radius of the shadow

The shape of the box-shadow is related to the shape of the element it is attached to

You can use devtools to help you understand it.

box-shadow

Read the document to have a deeper understanding of it.

Upvotes: 1

Related Questions