I'm facing an issue while attempting to apply a box-shadow
effect on my image. The problem arises due to certain transparent parts of the image causing unexpected results with the box-shadow
. To better understand the situation, refer to the code snippet below:
.framed-image {
background: url("https://cdn.pbrd.co/images/HfNQr1M.png") no-repeat;
background-size: cover;
padding: 18px;
object-fit: cover;
}
.image-menu {
width: 300px;
height: 200px;
background-size: 100% 100% !important;
-moz-box-shadow: 0 3px 8px rgb(136, 136, 136);
-webkit-box-shadow: 0 3px 8px rgb(136, 136, 136);
box-shadow: 0 3px 8px rgb(136, 136, 136);
}
<div class="image-menu-parent">
<img class="framed-image image-menu" src="http://placehold.it/1/365f83">
</div>
The visible white background in the transparent areas of the image is posing a challenge for applying the box-shadow
correctly. How can I rectify this issue and ensure the proper utilization of the box-shadow
? Your assistance is highly appreciated! ♥