I have a div box with box-shadow set around it with the following CSS:
-moz-box-shadow: 1px 1px 15px #415a68;
-webkit-box-shadow: 1px 1px 15px #415a68;
-khtml-box-shadow: 1px 1px 15px #415a68;
box-shadow: 1px 1px 15px #415a68;
What can I do to make box-shadow only apply to the left, right and bottom of the div?
The box-shadow styles are used to pay attention to the content. Primer CSS Box Shadow Remove style is mainly used to remove the box-shadow. To remove the box-shadow, we will add an additional class . box-shadow-none.
Use the box-shadow Property to Set the Bottom Box Shadow in CSS. We can use the box-shadow property to set the shadow only at the bottom of the box. The box-shadow property sets the shadow of the selected element.
The following example shows how to set Box-Shadow so that it will only show a shadow for the inset top and bottom of an element. The key to accomplishing this is to set the blur value to <= the negative of the spread value (ex. inset 0px 5px -?
You cannot do this with ONE .div
EDIT
box-shadow
does not allow right and left shadows at the same time.
There is a trick, though...read on.
The rule takes four values:
That is all true. However, after some tests I found you can layer shadows.
All you need to do is separate the values with a comma.
So, for a left, right, and bottom shadow on one div, you can do this
box-shadow: -5px 5px 3px black, 5px 5px 3px black;
Example: http://jsfiddle.net/jasongennaro/HWCzJ/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With