Sitemap
Learn Web Development | For Complete Beginners

Detailed posts on web development. Go from Level 0 to Level Hero. Follow me if you like the content. Feedback is always appreciated 😇

CSS — Box Shadow

2 min readAug 15, 2022

--

Press enter or click to view image in full size
CSS- Box Shadow
CSS- Box Shadow

The box-shadow CSS property adds shadow effects around an element's frame. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color.

Adding a simple shadow:

We need to define the X offset, Y offset, and Shadow Color

box-shadow: 60px -16px teal;
Press enter or click to view image in full size
Adding a simple box-shadow
Adding a simple box-shadow

Add blur to the shadow:

We need to define the X offset, Y offset, Blur Radius, and Shadow Color

box-shadow: 10px 5px 5px black;
Press enter or click to view image in full size
Adding Blur Radius to box-shadow
Adding Blur Radius to box-shadow

Add spread to the shadow:

We need to define the X offset, Y offset, Blur Radius, Spread Radius, and Shadow Color

box-shadow: 5px 5px 5px 2px rgba(0, 0, 0, 0.2);
Press enter or click to view image in full size
Adding Spread Radius to box-shadow
Adding Spread Radius to box-shadow

Adding multiple shadows:

box-shadow: 3px 3px red, -1em 0 0.4em olive;
Press enter or click to view image in full size
Adding multiple shadows
Adding multiple shadows

Have fun playing with box-shadow and dig even deeper in the same property by using our good friend Google ;)

Get TARUN KUMAR’s stories in your inbox

Join Medium for free to get updates from this writer.

Instructor ~ TARUN KUMAR

LAZY SYNTAX

--

--

TARUN KUMAR
TARUN KUMAR

Web/App Developer | Teaching Students all Over India

Learn Web Development | For Complete Beginners
Learn Web Development | For Complete Beginners

Detailed posts on web development. Go from Level 0 to Level Hero. Follow me if you like the content. Feedback is always appreciated 😇