I was testing the box-shadow
property to make a gallery and realized that the <img>
tag does not accept box-shadow:inset...
but accepts box-shadow
normal.
However if I put <img>
as the background of a div
the box-shadow:inset
works perfectly!
My question would be: How to put box-shadow: inset without having to use the image as background?
Simple template to exemplify
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 it does not have the option of inset