How can I overlap these two images and keep the overlap responsive?
Hi, I am trying to replicate this design with two overlapping images and a vertical caption. The vertical caption should start in line with the bottom of the top-most image.
I have first tried using position: absolute; on the images and setting their heights to 80%. Then setting image one to top: 0; left: 0; and image two to bottom: 0, right: 0;. This worked but wasn't great responsively.
I thought maybe a grid would work better for this, however I'm still having trouble with responsiveness.
Here is my current code using grid: https://codepen.io/CR53/pen/xxmpoPW
Would love some help with this, been scratching my head over it for too long now π
3 Replies
i would remove styling from
.caption-image-wrapper
and remove width from .overlapping-images
Iβd probably position them absolute. And use z-index property. Donβt forget to use position: relative on parent container.
You could use grid to stack them, then there's no need for absolute positioned items and z-index. Something like this.