I'm using border-radius
and box-shadow
to make a glow around an element.
Can I remove only the top part of the box-shadow
?
div {
margin-top: 25px;
color: #fff;
height: 45px;
margin-top: -5px;
z-index: -10;
padding: 26px 24px 46px;
font-weight: normal;
background: #000; /*#fff;*/
border-top: 0px solid #e5e5e5;
border-left: 1px solid #e5e5e5;
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(200,200,200,0.7) 0px 0px 10px 0px;
-khtml-box-shadow: rgba(200,200,200,0.7) 0px 0px 10px 0px;
-moz-box-shadow: rgba(200,200,200,0.7) 0px 0px 10px 0px;
box-shadow: rgba(200,200,200,0.7) 0px 0px 10px 0px;
}
Edit: this little thingy is the problem!
You can try the following. My method only uses CSS.
Example Link : http://jsfiddle.net/kL8tR/56/
Basically what I am doing, I am creating multi-layer shadows, so the first shadow overlays the second layer, masking the top section.
I have used this before, here is my reference :
Look under section - Layering multiple shadows [ http://www.css3.info/preview/box-shadow/ ]
you could just shift the shadow lower down (vertical displacement) and reduce the shadow radius, something along the lines of (replace the asterisk with the amount of pixels needed to just cover the top shadow with the box itself):
This works, but I'll admit to not knowing if there's a better way (or if it's possible without adding a wrapper element). Using multiple
box-shadow
s would be a good idea, but I can't seem to make it look the same.See: http://jsfiddle.net/thirtydot/8qEUc/3/
HTML:
CSS:
If you use a negative spread radius and calibrate the other parameters to suit what your looking for it should give you the desired effect.
CSS Box Shadow Negative Radius Spread
Since you use box-shadow, you can use pseudo-element to create it and place under your div, placing it so only the needed parts would be visible: http://jsfiddle.net/kL8tR/60/
There are some important notes:
z-index: -1
position: relative
and noz-index
Pseudo-elements + CSS3 = awesomeness :)
@milo; is not your top border it's a
shadow
which you give in your codefor removing top glow you have to define vertical spacing of your shadow.
Write this in your shadow css:
& your can generate from here http://css3generator.com/
NOTE: there are four properties of shadow are
horizontal, vertical, blur & spread
for inside shadow you can defineinset
for it