Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Box Shadow Bottom Only [duplicate]

How can I do this? I want my element to look as though it has a shadow underline. I don't want the shadow for the other 3 sides.

like image 289
WillingLearner Avatar asked Dec 30 '10 08:12

WillingLearner


People also ask

How do you box shadow only the bottom?

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.

How do you box shadow only the top and bottom?

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 -?

How do you add a shadow to only one side?

To apply a shadow effect only on one side of an element set the blur value to a positive number and set the spread value to the same size but with a negative sign. Depending on which side you want the shadow on, set the offset value as follows: Top shadow: offset-x: 0 and offset-y: -5px.

What is inset in box shadow?

The presence of the inset keyword changes the shadow to one inside the frame (as if the content was debossed inside the box). Inset shadows are drawn inside the border (even transparent ones), above the background, but below content. <offset-x> <offset-y>


1 Answers

Do this:

box-shadow: 0 4px 2px -2px gray; 

It's actually much simpler, whatever you set the blur to (3rd value), set the spread (4th value) to the negative of it.

like image 96
Steve B Avatar answered Oct 18 '22 09:10

Steve B