I have a png photo. "Filter: drop-shadow" worked well with my png photo. However, I want to hide my png photo and keep the shadow.
I tried to set the value of translate and drop-shadow x-axis to achieve. The below CSS code worked.
Also, I think it is possible to achieve it by using photoshop. However, is it possible to hide the png image by CSS directly?
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
:root {
--distance: 100vw;
}
.photo {
width: 100%;
filter: drop-shadow(var(--distance) 10px 5px #ff0000);
position: relative;
display: block;
transform: translate(-100%, 0%);
}
<div>
<img src="nba.png" alt="..." class="photo">
</div>