3
I was testing the property box-shadow
to make a gallery and realized that the tag <img>
does not accept the box-shadow:inset...
but accepts the box-shadow
normal.
However if I put the <img>
as a background to div
the box-shadow:inset
works right!
My doubt would be: How to put box-shadow:inset without having to use the image as background?
Simple model to illustrate
html, body {
height: 100%;
width: 100%;
margin: 20px;
}
div {
width: 200px;
height: 200px;
margin: 40px 0;
background-image: url(http://fillmurray.com/200/200);
box-shadow: inset 0 0 10px 10px red, 0 0 5px 10px #000000;
-moz-box-shadow: inset 0 0 10px 10px red, 0 0 5px 10px #000000;
-webkit-box-shadow: inset 0 0 10px 10px red, 0 0 5px 10px #000000;
}
img.bs {
display: block;
margin: 40px 0;
box-shadow: inset 0 0 10px 10px red, 0 0 5px 10px #000000;
-moz-box-shadow: inset 0 0 10px 10px red, 0 0 5px 10px #000000;
-webkit-box-shadow: inset 0 0 10px 10px red, 0 0 5px 10px #000000;
}
img.ds {
filter: drop-shadow(0px 0px 10px red);
-webkit-filter: drop-shadow(0px 0px 10px red);
}
<div></div>
<img class="bs" src='http://fillmurray.com/200/200' alt=''/>
<img class="ds" src='http://fillmurray.com/200/200' alt=''/>
NOTE: I also tried with the property filter:drop-shadow
but she doesn’t have the option of inset
The style you set is reset...
box-shadow: inset 0 0 0 0 #000000
and the shadow has to be above the image and not outside the image.– hugocsl