Updated on Kisan Patel
This tutorial will go through the box-shadow property of css. A css box-shadow
property will give an element of html a new look by adding different styled shadows.
Syntax:
box-shadow: horizontal-offset vertical-offset blur-radius spread-radius color;
Explanation of all attribute values used in above box-shadow
syntax:
Here is the example of css box-shadow
property:
<!-- HTML --> <div class="box basic"> <h1>C# Code (csharpcode.org)</h1> </div> <!-- CSS --> <style type="text/css"> body { background:#E6E6E6; } .box { width:70%; height:100px; background:#FFF; margin:40px auto; text-align:center } .basic{ -webkit-box-shadow: 0 10px 6px -6px #777; -moz-box-shadow: 0 10px 6px -6px #777; box-shadow: 0 10px 6px -6px #777; } </style>
A basic shadow applied to a box like above will look like this:
See the Pen mJgmyM by Kisan (@pka246) on CodePen.