CSS box-shadow Property

CSS box-shadow Property


CSS Box Shadow Property 
Using CSS we can make a shadow of a box. 
This is controlled by the box-shadow property. 
A box-shadow has a color, and its dimensions can be specified with up to six values, which are given down below - 
In other words, they can also be said as property value 
  1. offset-x  - the horizontal distance.
  2. offset-y  - the vertical distance.
  3. blur-radius  - 0 by default. value cannot be negative. the bigger the value, the bigger and lighter the shadow becomes.
  4. spread-radius  - Zero by default. positive values will cause the shadow to expand. negative values will cause the shadow to shrink.
  5. inset  - by default, the shadow is treated as a drop shadow. the inset keyword draws the shadow inside the frame/border.
  6.  Color  - Color can be of various notations: a color keyword, hexadecimal, rgb(), rgba(), hsl(), hsla().
Now we will see the syntax -
Syntax - 
box-shadow: none|h-offset v-offset blur spread color |inset|initial|inherit;
Now we will see various kinds of example - 
Example 1 - A simple box shadow - 
class="shadow">
Output  -
We can also add a blur radius to blur the shadow, as demonstrated in the Example below - 
Example 2 -  Adding a blur radius - 
class="shadow">
Output - 
Example 3 -  Adding a spread radius without a blur radius
class="shadow">
Output  -
Finally, we can apply the blur radius again to see the full result - 
Example - Shadow with a blur and spread radius
class="shadow">
Output  -
Example - Setting the X and Y offsets to zero
class="shadow">
Output -
Example - multiple shadows
class="box_shadow">
Output -