How to make both top and bottom border shadow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show Show hidden characters
The The Box-shadow generator is an interactive tool allowing you to generate a
Specify a single box-shadow using:
To specify multiple shadows, provide a comma-separated list of shadows. Optional Specifies color for the shadow. See box-shadow =
hash%5Fmark)question%5Fmark) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)[[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax brackets) <'box-shadow-offset'> [[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) <'box-shadow-blur'> <'box-shadow-spread'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets)[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)<'box-shadow-position'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax question%5Fmark)6 values for possible keywords and notations. If not specified, the value of the box-shadow =
hash%5Fmark)question%5Fmark) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)[[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax brackets) <'box-shadow-offset'> [[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) <'box-shadow-blur'> <'box-shadow-spread'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets)[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)<'box-shadow-position'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax question%5Fmark)9 property defined in the parent element is used. Specifies the offset length of the shadow. This parameter accepts two, three, or four values. Third and fourth values are optional. They are interpreted as follows:
Changes the shadow from an outer box-shadow to an inner box-shadow (as if the content is pressed into the box). Inset shadows are drawn inside the box's border (even if the border is transparent), and they appear above the background but below the content. By default, the shadow behaves like a drop shadow, giving the appearance that the box is elevated above its content. This is the default behavior when box-shadow =
hash%5Fmark)question%5Fmark) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)[[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax brackets) <'box-shadow-offset'> [[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) <'box-shadow-blur'> <'box-shadow-spread'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets)[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)<'box-shadow-position'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax question%5Fmark)5 is not specified. When animating shadows, such as when multiple shadow values on a box transition to new values on hover, the values are interpolated. Interpolation determines intermediate values of properties, such as the blur radius, spread radius, and color, as shadows transition. For each shadow in a list of shadows, the color, x, y, blur, and spread transition; the color as box-shadow =
hash%5Fmark)question%5Fmark) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)[[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax brackets) <'box-shadow-offset'> [[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) <'box-shadow-blur'> <'box-shadow-spread'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets)[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)<'box-shadow-position'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax question%5Fmark)6, and the other values as box-shadow =
hash%5Fmark)question%5Fmark) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)[[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax brackets) <'box-shadow-offset'> [[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) <'box-shadow-blur'> <'box-shadow-spread'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets)[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)<'box-shadow-position'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax question%5Fmark)0s. In interpolating multiple shadows between two comma-separated lists of multiple box shadows, the shadows are paired, in order, with interpolation occurring between paired shadows. If the lists of shadows have different lengths, then the shorter list is padded at the end with shadows whose color is
9, and X, Y, and blur are
5, with the inset, or lack of inset, being set to match. If in any pair of shadows, one has box-shadow =
hash%5Fmark)question%5Fmark) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)[[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax brackets) <'box-shadow-offset'> [[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) <'box-shadow-blur'> <'box-shadow-spread'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets)[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)<'box-shadow-position'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax question%5Fmark)5 set and the other does not, the entire shadow list is uninterpolated; the shadows will change to the new values without an animating effect. Initial value
2Applies toall elements. It also applies to
3.InheritednoComputed valueany length made absolute; any specified color computed; otherwise as specifiedAnimation typea box-shadow =
hash%5Fmark)question%5Fmark) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)[[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax brackets) <'box-shadow-offset'> [[](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) <'box-shadow-blur'> <'box-shadow-spread'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets)[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxquestion%5Fmark) []](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxbrackets) [&&](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntaxdouble%5Fampersand)<'box-shadow-position'>[?](https://developer.mozilla.org/en-US/docs/Web/CSS/Value%5Fdefinition%5Fsyntax question%5Fmark)In this example, we include three shadows: an inset shadow, a regular drop shadow, and a 2px shadow that creates a border effect (we could have used an
4 instead for that third shadow). HTML
CSS
ResultWhen the
5,
6, and
7 are all zero, the box shadow will be a solid-colored outline of equal-size on all sides. The shadows are drawn back to front, so the first shadow sits on top of subsequent shadows. When the We added a margin the size of the widest box-shadow to ensure the shadow doesn't overlap adjacent elements or go beyond the border of the containing box. A box-shadow does not impact box model dimensions. How do you get a box shadow on top and bottom?Element CSS We can get top bottom box shadow only by applying two shadows on an element. This approach will give us more control over the amount of shadow in each direction. You can played around and adjust the values of box-shadow property in our multiple box shadow generator to get more exiting results. How do you make two shadows?A: You get two shadows when the light is coming from two main sources, maybe two different street lamps. How do you put a shadow on the bottom border?CSS Box Shadow Bottom Only. h-shadow: The horizontal offset of the shadow. ... . v-shadow: The vertical offset of the shadow. ... . blur: The blur radius of the shadow. ... . spread: The spread radius of the shadow. ... . color: The color of the shadow.. inset: Optional.. How do you add multiple box shadows?Multiple box-shadows can be created by using commas to separate properties of each box-shadow element. Here's an example of the CSS to create multiple shadows with some blur, at mostly-transparent black colors: box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); |