Shadow box over the border

I have this problem when I want to have a border and a shadow, but the shadow should be above the border.

The box-shadow property starts when the border ends, is it possible to move it along the border?

.border
{       
    border: solid rgba(128,42,42,.98) 16px;
}


.img-box-shadow
{
    -moz-box-shadow: 0px 0px 20px #000000;
    -webkit-box-shadow: 0px 0px 20px #000000;
    box-shadow: 0px 0px 20px #000000;
}

My HTML:

<img class="border img-box-shadow" src="img.png">

Already tried to paste into my shadow, but it did not work!

I am looking for this effect:

border

And I get this result:

shadow in border

+3
source share
5 answers

I think it would be much easier to achieve with two boxed shadow shadows.

Something like this fits what you are looking for

box-shadow: 0 0 20px 5px #000000,
    0 0 0 16px rgba(128,42,42,.98);
+2
source

You can try using insert and then lower the alpha value of your border. It may not be exactly what you want, but it is close.

.border
{       
    border: solid rgba(128,42,42,.5) 4px;
}


.img-box-shadow
{
    -moz-box-shadow: inset 0px 0px 20px #000000;
    -webkit-box-shadow: inset 0px 0px 20px #000000;
    box-shadow: inset 0px 0px 20px #000000;
}

( ). .border ( ):

.img-box-shadow
    {
        box-shadow: rgba(0,0,0,.98) 0px 0px 3px, inset rgba(0,0,0,.98) 0px -2px 3px;
    }

JSFiddle

0

, inset, :

box-shadow: inset 0 -15px 10px -10px #444;
-moz-box-shadow: inset 0 -15px 10px -10px #444;
-webkit-box-shadow: inset 0 -15px 10px -10px #444;

0

?

.ds-bottom {
  position:relative;
  overflow:hidden; 
  border-bottom:1px solid #ddd; 
}
.ds-bottom:before {
  content: ""; 
  position:absolute; 
  z-index: 1; 
  width:96%;  
  bottom: -10px; 
  height: 10px; 
  left: 2%; 
  border-radius: 100px / 5px; 
  box-shadow:0 0 18px rgba(0,0,0,0.6); 
}
0

-, .

 box-shadow: 0px 0px 20px #000000;

box-shadow: 0px 0px 20px 0 #000000;

-

box-shadow: ;

, , div. Box-shadow .

div { 
  display:inline-block;
  padding:4px; /* Act as border width */
  background:rgba(128,42,42,.98); /* Act as border color */
}

.img-box-shadow
{
  box-shadow: inset 0px 0px 20px 0 #000000;
  -webkit-box-shadow: inset 0px 0px 20px 0 #000000;
  -moz-box-shadow: inset 0px 0px 20px 0 #000000;
}

HTML-

<div class="img-box-shadow">
<img src="http://graph.facebook.com/715380382/picture?type=large">
</div>

http://jsbin.com/hex/1/edit

0

All Articles