Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove box shadow from only top of div?

Tags:

css

I am trying to add a box shadow to my div but i only want the shadow to appear on the left, right and bottom of the div, does anyone know or can show me how i might remove only the top shadow from my div?

-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
 -khtml-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
   -moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
        box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
like image 410
jason derulo Avatar asked Oct 17 '13 13:10

jason derulo


People also ask

How do you get a box shadow only on the bottom?

To display the shadow at the bottom of the image, the “box-shadow” property is used. For this purpose, offset-x is set as “0”, offset-y is any positive value, and the color you want to display is also set.

How do you put a box shadow on top of a div?

It's #top and its box-shadow that you want to appear on top, so give that position: relative instead of giving position: relative to #middle . There's no need for z-index: 0 . Save this answer.

How do you put a shadow on one side of a div?

box-shadow: h-offset v-offset blur spread color; box-shadows values: h-offset: It is required and used to set the position of the shadow horizontally. The positive value is used to set the shadow on right side of the box and a negative value is used to set the shadow on the left side of the box.

How do I get rid of box shadow in media query?

box-shadow: none; To disable the shadow.


1 Answers

The basic Box-shadow values are:

box-shadow: [horizontal-offset] [vertical-offset] [blur](optional) [spread](optional) [color]

So for example:

box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);

would just be a shadow with no offset

box-shadow: 0px 5px 8px rgba(0, 0, 0, 0.3);

would be a shadow with 5px vertical offset, effectively pushing the shadow down, like so:

http://jsfiddle.net/TLQs9/

like image 69
MLeFevre Avatar answered Sep 23 '22 08:09

MLeFevre