Is there a way to drop the shadow only on the bottom?. I have a menu with 2 images next to each other. I don’t want a right shadow because it overlaps the right image. I don’t like to use images for this so is there a way to drop it only on the bottom like:
box-shadow-bottom: 10px #FFF; or similar?
-moz-box-shadow: 0px 3px 3px #000;
-webkit-box-shadow: 0px 3px 3px #000;
box-shadow-bottom: 5px #000;
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#000000');
UPDATE 4
Same as update 3 but with modern css (=fewer rules) so that no special positioning on the pseudo element is required.
UPDATE 3
All my previous answers have been using extra markup to get create this effect, which is not necessarily needed. I think this is a much cleaner solution… the only trick is playing around with the values to get the right positioning of the shadow as well as the right strength/opacity of the shadow. Here’s a new fiddle, using pseudo-elements:
http://jsfiddle.net/UnsungHero97/ARRRZ/2/
HTML
CSS
UPDATE 2
Apparently, you can do this with just an extra parameter to the box-shadow CSS as everyone else just pointed out. Here’s the demo:
http://jsfiddle.net/K88H9/821/
CSS
This would be a better solution. The extra parameter that is added is described as:
UPDATE
Check out the demo at jsFiddle: http://jsfiddle.net/K88H9/4/
What I did was to create a "shadow element" that would hide behind the actual element that you would want to have a shadow. I made the width of the "shadow element" to be exactly less wide than the actual element by 2 times the shadow you specify; then I aligned it properly.
HTML
CSS
Original Answer
Yes, you can do this with the same syntax you have provided. The first value controls the horizontal positioning and the second value controls the vertical positioning. So just set the first value to
0pxand the second to whatever offset you’d like as follows:For more info on box shadows, check out these: