How to make shadow on border-bottom?

box-shadow bottom
css box-shadow examples
border shadow css
box-shadow: inset
box-shadow mdn
box-shadow top
box-shadow all sides
shadow scss

I need to apply the border shadow on border-bottom by CSS3. I just want to apply CSS3 shadow on bottom. Is this possible?

Try:

div{
-webkit-box-shadow:0px 1px 1px #de1dde;
 -moz-box-shadow:0px 1px 1px #de1dde;
 box-shadow:0px 1px 1px #de1dde;
  }
<div>wefwefwef</div>

CSS box-shadow property, border-bottom border-bottom-color border-bottom-left-radius border-bottom-​right-radius border-bottom-style border-bottom-width border-collapse The box-​shadow property attaches one or more shadows to an element. If you do not specify the color, the shadow is not displayed at all. border: 1px solid #BFBFBF​; How to Disable (or Enable) Shadows. Windows 10 enables drop shadows for each window by default. However, you can turn these shadows off if you prefer. Windows 8 didn’t use shadows and had a clean, flat look with colored window borders, for example.

The issue is shadow coming out the side of the containing div. In order to avoid this, the blur value must equal the absolute value of the spread value.

div {
  -webkit-box-shadow: 0 4px 6px -6px #222;
  -moz-box-shadow: 0 4px 6px -6px #222;
  box-shadow: 0 4px 6px -6px #222;
}
<div>wefwefwef</div>

CSS Box Shadow, Used in casting shadows off block-level elements (like divs). .shadow will be on the right of the box, a negative offset will put the shadow on the left of the box. You can try using it with border-radius to create a curved edge. element doesn't stretch completely to the bottom of the screen/browser…what  inset: Specifies whether the shadow will be inside or outside the frame. You can omit this property. offset-x: You can set the length of the shadow effect. You can specify negative values to render the shadow to the left. offset-y: You can set the length of the shadow effect. You can specify negative values to render the shadow to the top.

use box-shadow with no horizontal offset.

http://www.css3.info/preview/box-shadow/

eg.

div {
  -webkit-box-shadow: 0 10px 5px #888888;
  -moz-box-shadow: 0 10px 5px #888888;
  box-shadow: 0 10px 5px #888888;
}
<div>wefwefwef</div>

CSS: Emulate borders with inset box shadows, When both parent and child elements have borders, with this technique you don't get two border-bottom: 1px solid red, box-shadow: inset 0 -1px 0 0 red. What I did was 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

New method for an old question

It seems like in the answers provided the issue was always how the box border would either be visible on the left and right of the object or you'd have to inset it so far that it didn't shadow the whole length of the container properly.

This example uses the :after pseudo element along with a linear gradient with transparency in order to put a drop shadow on a container that extends exactly to the sides of the element you wish to shadow.

Worth noting with this solution is that if you use padding on the element that you wish to drop shadow, it won't display correctly. This is because the after pseudo element appends it's content directly after the elements inner content. So if you have padding, the shadow will appear inside the box. This can be overcome by eliminating padding on outer container (where the shadow applies) and using an inner container where you apply needed padding.

Example with padding and background color on the shadowed div:

If you want to change the depth of the shadow, simply increase the height style in the after pseudo element. You can also obviously darken, lighten, or change colors in the linear gradient styles.

body {
  background: #eee;
}

.bottom-shadow {
  width: 80%;
  margin: 0 auto;
}

.bottom-shadow:after {
  content: "";
  display: block;
  height: 8px;
  background: transparent;
  background: -moz-linear-gradient(top, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%); /* FF3.6-15 */
  background: -webkit-linear-gradient(top, rgba(0,0,0,0.4) 0%,rgba(0,0,0,0) 100%); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%,rgba(0,0,0,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient(   startColorstr='#a6000000', endColorstr='#00000000',GradientType=0 ); /* IE6-9 */
}

.bottom-shadow div {
  padding: 18px;
  background: #fff;
}
<div class="bottom-shadow">
  <div>
    Shadows, FTW!
  </div>
</div>

A Close Look at CSS Box Shadow, How do you get a box shadow on all sides? Optional. The blur radius. The higher the number, the more blurred the shadow will be: Play it » spread: Optional. The spread radius. A positive value increases the size of the shadow, a negative value decreases the size of the shadow: Play it » color: Optional. The color of the shadow. The default value is the text color.

funny, that in the most answer you create a box with the text (or object), instead of it create the text (or object) div and under that a box with 100% width (or at least what it should) and with height what equal with your "border" px... So, i think this is the most simple and perfect answer:

<h3>Your Text</h3><div class="border-shadow"></div>

and the css:

    .shadow {
        width:100%;
        height:1px; // = "border height (without the shadow)!"
        background:#000; // = "border color!"
        -webkit-box-shadow: 0px 1px 8px 1px rgba(0,0,0,1); // rbg = "border shadow color!"
        -moz-box-shadow: 0px 1px 8px 1px rgba(0,0,0,1); // rbg = "border shadow color!"
        box-shadow: 0px 1px 8px 1px rgba(0,0,0,1); // rbg = "border shadow color!"

}

Here you can experiment with the radius, etc. easy: https://www.cssmatic.com/box-shadow

Complete Tutorial on CSS Shadow and Creating CSS Drop Shadow, How do you put a shadow on an image in CSS? Create below_shadow xml file, then in your view, add a "View" in your layout and set below_shadow.xml as background of this view – Morteza Rastgoo May 7 '16 at 5:22 I did the same as you told, but my "above_shadow" is not transparent when i put that view in the custom view.

How to Place Border Inside of DIV Element Using CSS, of the element's box using the CSS3 outline-offset property with a negative value. Specifies no border. Specifies a 3D grooved border. Specifies a 3D ridged border. Specifies a 3D inset border. Specifies a 3D outset border. Sets this property to its default value. Inherits this property from its parent element.

Using box-shadow to construct a border, So, adding a border to a box, is pretty simple when you use the border box-​shadow: 0 1px 0 0 red; /* Border bottom */ box-shadow: 0 -1px 0 0  Specifies the width of the bottom border. Specifies the style of the bottom border. Specifies the color of the bottom border. Sets this property to its default value. Inherits this property from its parent element.

Box shadow only bottom, if you want add box shadow for only bottom (top, left, right) of box, it's here The steps given below are required to be followed in order to use Border Shadow Effect in your controls in Xamarin.Forms application. Step 1. Go to Visual Studio for Mac. Click New Solution >> Multiplatform >> App >> Blank Forms App.

Comments
  • This is covered in depth here: stackoverflow.com/questions/5460129/…
  • It is good. But I have only bottom border and I want to shade it. When I use above code, left and right shadow are also appear.
  • all these asnwers are not relevant - because it always create other unwanted shadows :)
  • Can't you see that there is no bottom shadow? There are shadows everywhere around element except for top
  • Downvoted because it generates a shadow around the whole element. Consider the answer from Bill Bruilding.