Menu

1 / 2

CSS Box Shadow: The Complete Guide to Shadows, Layers, and Design Patterns

DEV Community: frontend·Snappy Tools·5 months ago
#SSbiMooF
#dev#shadow#rgba#enter#article
Reading 0:00
15s threshold

box-shadow is one of CSS's most versatile properties. Its syntax has six parameters and supports multiple layered shadows — which makes it powerful and also easy to get wrong. Here's everything you need to know.

The syntax

box-shadow : offset-x offset-y blur-radius spread-radius color ; box-shadow : offset-x offset-y blur-radius spread-radius color inset ;

Enter fullscreen mode

Exit fullscreen mode

offset-x: Horizontal offset. Positive = right, negative = left.

offset-y: Vertical offset. Positive = down, negative = up.

blur-radius: How blurry the shadow is. 0 = sharp edge. Larger = softer. Default: 0.

spread-radius: Expands or shrinks the shadow. Positive = larger, negative = smaller. Default: 0.

color: Shadow color. Default: the text color ( currentColor ).

inset: Keyword.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.