I'm looking for a way to maintain the cropped image but place content inside it with an opacity filter on the div. The challenge I am encountering is getting the angles to match up correctly and not being able to use an overlap hidden feature. Can anyone assist me in finding a solution? It's unfortunate that using ::after on the image to add a filter div won't work to darken a section. :(
.promo {
position: relative;
}
.promo img {
-webkit-clip-path: polygon(0 16%, 100% 0, 100% 100%, 0% 84%);
clip-path: polygon(0 16%, 100% 0, 100% 100%, 0% 84%);
}
.promo__content {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 50%;
height: 100% color: #fff;
background: black;
}
<div class="promo">
<img src="https://i.picsum.photos/id/100/600/600.jpg" >
<div class="promo__content">
Content Here
</div>
</div>
This is an example of what I am attempting to achieve – incorporating a transparent black box within the angled image: